// -------- begin template --------

#![allow(
    dead_code, unused_imports, unused_variables,
    unused_must_use, unused_macros, unused_mut, unused_assignments
)]

use std::io::{self, Read, Write};
use std::cmp::{min, max};
use std::mem::swap;
use std::collections::{VecDeque, HashMap, HashSet, BTreeSet};

macro_rules! dbg {
    ($first_val:expr, $($val:expr),+ $(,)?) => {
        eprint!("[{}:{}] {} = {:?}",
                    file!(), line!(), stringify!($first_val), &$first_val);
        ($(eprint!(", {} = {:?}", stringify!($val), &$val)),+,);
        eprintln!();
    };
    ($first_val:expr) => {
        eprintln!("[{}:{}] {} = {:?}",
                    file!(), line!(), stringify!($first_val), &$first_val);
    };
}

enum InputSource {
    Stdin,
    FromFile(Vec<String>),
}

struct Scanner {
    buffer: Vec<String>,
    input_source: InputSource,
}

impl Scanner {
    fn new() -> Self {
        Self {
            buffer: vec![],
            input_source: InputSource::Stdin,
        }
    }

    fn new_file(filename: &str) -> Self {
        let file = std::fs::read_to_string(filename).unwrap();
        let mut lines: Vec<String> = file.lines().map(|line| String::from(line)).collect();
        lines.reverse();
        Self {
            buffer: vec![],
            input_source: InputSource::FromFile(lines),
        }
    }

    fn usize(&mut self) -> usize { self.next::<usize>() }
    fn bytes(&mut self) -> Vec<u8> { self.next::<String>().into_bytes() }
    fn chars(&mut self) -> Vec<char> { self.next::<String>().chars().collect() }
    fn string(&mut self) -> String { self.next::<String>() }
    fn i64(&mut self) -> i64 { self.next::<i64>() }
    fn f64(&mut self) -> f64 { self.next::<f64>() }
    fn i32(&mut self) -> i32 { self.next::<i32>() }
    fn f32(&mut self) -> f32 { self.next::<f32>() }

    fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.next::<T>()).collect()
    }

    fn parse_next_line(&mut self) -> bool {
        let mut input = String::new();
        match &mut self.input_source {
            InputSource::Stdin => {
                if std::io::stdin().read_line(&mut input).expect("Failed read") == 0 {
                    return false;
                }
            }
            InputSource::FromFile(lines) => match lines.pop() {
                Some(line) => input = line,
                None => return false,
            },
        }

        self.buffer = input.split_whitespace().rev().map(String::from).collect();
        return true;
    }

    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            self.parse_next_line();
        }
    }

    fn has_more_elements(&mut self) -> bool {
        loop {
            if !self.buffer.is_empty() { return true; }
            if !self.parse_next_line() { return false; }
        }
    }
}

// -------- end template --------

fn to2(x: i64) -> Vec<i64> {
    let mut res: Vec<i64> = Vec::new();
    let mut tmp = x;
    while tmp > 0 {
        res.push(tmp & 1);
        tmp >>= 1;
    }
    res.reverse();
    res
}

fn to10(d: &Vec<i64>) -> i64 {
    if d.len() > 60 {
        return 0;
    }
    let (mut exp, mut res) = (1, 0);
    for i in (0..d.len()).rev() {
        if d[i] == 1 {
            res += exp;
        }
        exp *= 2;
    }
    res
}

fn go(x: i64, d: i64) -> i64 {
    let mut a = to2(x);
    a.push(d);
    a.reverse();
    to10(&a)
}

fn solve(x: i64, y: i64) -> bool {
    let mut q: VecDeque<i64> = VecDeque::new();
    let mut vis: HashSet<i64> = HashSet::new();
    q.push_back(x);
    while let Some(cur) = q.pop_front() {
        if cur == 0 { continue; }
        if vis.contains(&cur) { continue; }
        vis.insert(cur);
        if cur == y { return true; }

        q.push_back(go(cur, 0));
        q.push_back(go(cur, 1));
    }
    false
}

fn main() {
    let stdout = io::stdout();
    let mut out = std::io::BufWriter::new(stdout.lock());
    let mut sc = Scanner::new();

    let (x, y) = (sc.i64(), sc.i64());
    writeln!(out, "{}", if solve(x, y) { "YES" } else { "NO "});
}


//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

// ここまで

use std::cmp::{max, min};

fn run() {
    input! {
        a: i32,
        b: i32,
        x: i32,
        y: i32,
        n: i32,
    }
    let mut f = n;
    let mut g = 0;
    for i in 0..=n {
        if x * a < i || y * b < n - i{
            continue;
        }
        let mut p = 0;
        let mut q = 0;
        if (x - 1) * a < i {
            p += i - (x - 1) * a;
        }
        q += i / x;
        if (y - 1) * b < n - i {
            p += n - i - (y - 1) * b;
        }
        q += (n - i) / y;
        f = min(f, p);
        g = max(g, q);
    }
    println!("{} {}", f, g);
}

fn main() {
    run();
}


use std::io;
use std::str::SplitWhitespace;

fn main() {
    let mut input: String = String::new();
    io::stdin().read_line(&mut input).unwrap();
    let mut it_input: SplitWhitespace = input.split_whitespace();
    let n: i32 = it_input.next().unwrap().parse().unwrap();
    let m: i32 = it_input.next().unwrap().parse().unwrap();
    let r: i32 = it_input.next().unwrap().parse().unwrap();
    let mut n_input: String = String::new();
    let mut m_input: String = String::new();
    io::stdin().read_line(&mut n_input).unwrap();
    io::stdin().read_line(&mut m_input).unwrap();
    let mut it_n: SplitWhitespace = n_input.split_whitespace();
    let mut it_m: SplitWhitespace = m_input.split_whitespace();
    let mut n_min: i32 = 1001;
    let mut m_max: i32 = 0;
    for _i in 0..n {
        let a: i32 = it_n.next().unwrap().parse().unwrap();
        if a < n_min {
            n_min = a;
        }
    }
    for _i in 0..m {
        let a: i32 = it_m.next().unwrap().parse().unwrap();
        if a > m_max {
            m_max = a;
        }
    }
    if r / n_min * m_max + r % n_min > r {
        print!("{}", r / n_min * m_max + r % n_min);
    } else {
        print!("{}", r);
    }
}


// Try Codeforces
// author: Leonardone @ NEETSDKASU

fn main() {
    let mut stdin = String::new();
    std::io::Read::read_to_string(
        &mut std::io::stdin(),
        &mut stdin).unwrap();
    let mut stdin = stdin.split_whitespace();
    let mut get = || stdin.next().unwrap();
    macro_rules! get {
        ($t:ty) => (get().parse::<$t>().unwrap());
        () => (get!(i64));
    }

    let h = get!(usize);
    let w = get!(usize);
    let p = 998244353;
    let mut ans = 4;
    for i in 1 .. w {
        ans = (ans * 2) % p;
    }
    for j in 1 .. h {
        ans = (ans * 2) % p;
    }
    println!("{}", ans);
}


//spnauti-rusT {{{
use std::io::*; use std::str::{self,*}; use std::fmt::Debug;
#[allow(unused_imports)] use std::cmp::Ordering::{self,*};
#[allow(unused_imports)] use std::ops::{self,*};
#[allow(unused_imports)] use std::iter::{self,*};
#[allow(unused_imports)] use std::collections::*;
#[allow(unused_imports)] use std::cell::*;
#[allow(unused_macros)] macro_rules! min {
	($x:expr,$y:expr) => {{ let b=$y; let a=&mut$x; if b < *a {*a=b; true} else {false} }};
}
#[allow(unused_macros)] macro_rules! max {
	($x:expr,$y:expr) => {{ let b=$y; let a=&mut$x; if b > *a {*a=b; true} else {false} }};
}
#[allow(unused_macros)] macro_rules! l {
	($($v:ident),+ =$e:expr) => {$(let$v=$e;)+};
	($($v:ident),+:$t:ty=$e:expr) => {$(let$v:$t=$e;)+};
	(mut $($v:ident),+ =$e:expr) => {$(let mut$v=$e;)+};
	(mut $($v:ident),+:$t:ty=$e:expr) => {$(let mut$v:$t=$e;)+};
}
#[allow(unused_macros)] macro_rules! v {
	([$d:expr]$($s:tt)+) => {vec![v!($($s)+);$d]};
	([]) => {Vec::new()}; ([$e:expr]) => {Vec::with_capacity($e)}; (=$e:expr) => {$e};
}
#[allow(unused_macros)] macro_rules! rep { {[$c:expr]$($s:tt)+} => {for _ in 0..$c {$($s)+}} }
#[allow(dead_code)] fn reader() -> WordReaderC { WordReaderC::new() }
#[allow(dead_code)] fn writer() -> BufWriter<Stdout> { BufWriter::new(stdout()) }
struct WordReaderC {buf: Vec<u8>, pos: usize, q: std::io::StdinLock<'static>}//'
#[allow(dead_code)] impl WordReaderC {
	fn new() -> Self {
		let r = unsafe {&*Box::into_raw(Box::new(stdin()))};
		Self { q: r.lock(), buf: Vec::new(), pos: 0 }
	}
	fn next_line(&mut self) -> bool {
		self.buf.clear(); self.pos = 0;
		self.q.read_until(b'\n', &mut self.buf).unwrap_or(0) > 0
	}
	fn is_ws(c: u8) -> bool {
		c == b' ' || c == b'\r' || c == b'\n' || c == b'\t'
	}
	fn byte(&mut self) -> Option<u8> {
		if self.pos == self.buf.len() { if !self.next_line() { return None; } }
		self.pos += 1; Some(self.buf[self.pos - 1])
	}
	fn vb(&mut self) -> Vec<u8> {
		let mut s = Vec::with_capacity(8);
		let mut f = false;
		loop {
			if let Some(c) = self.byte() {
				if !Self::is_ws(c) {
					s.push(c);
					f = true;
				} else if f { break; }
			} else { break; }
		}
		s
	}
	fn s(&mut self) -> String { String::from_utf8(self.vb()).expect("invalid utf8") }
	fn i(&mut self) ->    i32 { self.p() }
	fn l(&mut self) ->    i64 { self.p() }
	fn u(&mut self) ->  usize { self.p() }
	fn f(&mut self) ->    f64 { self.p() }
	fn vi(&mut self, n: usize) -> Vec<i32> { self.vp(n) }
	fn vl(&mut self, n: usize) -> Vec<i64> { self.vp(n) }
	fn vu(&mut self, n: usize) -> Vec<usize> { self.vp(n) }
	fn ii(&mut self, n: usize) -> impl Iterator<Item=i32> { self.ip(n).into_iter() }
	fn iu(&mut self, n: usize) -> impl Iterator<Item=usize> { self.ip(n).into_iter() }
	fn p<T: FromStr>(&mut self) -> T where T::Err: Debug {
		let w = self.vb(); str::from_utf8(w.as_ref()).unwrap().parse::<T>().unwrap()
	}
	fn vp<T: FromStr>(&mut self, n: usize) -> Vec<T> where T::Err: Debug {
		(0..n).map(|_|self.p()).collect()
	}
	fn ip<T: FromStr>(&mut self, n: usize) -> impl Iterator<Item=T> where T::Err: Debug {
		self.vp(n).into_iter()
	}
}
//------------------- End rusT }}}

fn main() {
	let mut rin = reader();
	let mut rout = writer();

	let n = rin.u();
	l!(x,y = rin.l());
	let mut dp = v!([n+1]);
	dp.push(x);
	dp.push(x);
	for i in 2..=n {
		let z = dp[i-1] + x;
		let ii = i >> 1;
		dp.push(z);
		if i & 1 == 0 {
			min!(dp[i], dp[ii] + y);
		} else {
			min!(dp[i], dp[ii].min(dp[ii+1]) + y + x);
		}
	}
	writeln!(rout, "{}", dp[n]).ok();
}


//spnauti-rusT
use std::io::*;
use std::str::{self,*};
use std::fmt::Debug;
#[allow(unused_imports)] use std::cmp::Ordering::{self,*};
#[allow(unused_imports)] use std::ops::{self,*};
#[allow(unused_imports)] use std::iter::{self,*};
#[allow(unused_imports)] use std::collections::*;
#[allow(unused_macros)]
macro_rules! m {
    ($c:tt, $x:expr, $y:expr) => {{
        let b = $y; let a = &mut $x;
        if b $c *a { *a = b; true } else { false }
    }};
}
#[allow(unused_macros)]
macro_rules! l {
    ($($v:ident),* = $i:ident.$f:ident $a:tt) => {
        $( let $v = $i.$f$a; )*
    };
    ($($v:ident),*:$t:ty = $i:ident.$f:ident $a:tt) => {
        $( let $v:$t = $i.$f$a; )*
    };
}
struct WordReader<'a> { it : SplitAsciiWhitespace<'a> }
#[allow(dead_code)]
impl<'a> WordReader<'a> {
    fn new<T: Read>(b: &mut String, mut r: T) -> WordReader {
        b.clear();
        r.read_to_string(b).ok();
        WordReader { it: b.split_ascii_whitespace() }
    }
    fn from_stdin(b: &mut String) -> WordReader {
        WordReader::new(b, stdin())
    }
    fn sl(&mut self) ->  &str { self.it.next().unwrap() }
    fn bs(&mut self) -> &[u8] { self.sl().as_bytes()    }
    fn s(&mut self) -> String { String::from(self.sl()) }
    fn i(&mut self) ->    i32 { self.p()                }
    fn f(&mut self) ->    f64 { self.p()                }
    fn u(&mut self) ->  usize { self.p()                }
    fn sk(&mut self, n: usize) { self.it.nth(n - 1); }
    fn ii(&mut self, n: usize) -> impl Iterator<Item=i32> {
        self.ip(n).into_iter()
    }
    fn vi(&mut self, n: usize) -> Vec<i32> {
        self.vp::<i32>(n)
    }
    fn p<T: FromStr>(&mut self) -> T where T::Err: Debug {
        self.sl().parse::<T>().unwrap()
    }
    fn ip<T: FromStr>(&mut self, n: usize) -> impl Iterator<Item=T> where T::Err: Debug {
        self.vp(n).into_iter()
    }
    fn vp<T: FromStr>(&mut self, n: usize) -> Vec<T> where T::Err: Debug {
        (0..n).map(|_| self.p()).collect()
    }
}
//------------------- End rusT

fn main() {
    let mut bin = String::new();
    let mut input = WordReader::from_stdin(&mut bin);

    let n = input.i();
    if n == 1 {
        println!("-1");
    } else {
        println!("{} {}", n, n);
    }
}


use std::io;
use std::str;

pub struct Scanner<R> {
    reader: R,
    buffer: Vec<String>,
}

impl<R: io::BufRead> Scanner<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buffer: vec![],
        }
    }

    pub fn token<T: str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            self.reader.read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn is_prime(n: i64) -> bool {
    let mut d = 2;
    while d * d <= n {
        if n % d == 0 {
            return false;
        }
        d += 1;
    }
    true
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let t: u32 = scan.token();
    for _ in 0..t {
        let a: i64 = scan.token();
        let b: i64 = scan.token();
        if a - b == 1 && is_prime(a + b) {
            writeln!(out, "YES").ok();
        } else {
            writeln!(out, "NO").ok();
        }
    }
}

fn main() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());
    solve(&mut scan, &mut out);
}


#![allow(unused_imports)]
use std::io::*;
use std::cmp::*;
use std::collections::*;

macro_rules! debug(
    ($($arg:tt)*) => { {
        let r = writeln!(&mut ::std::io::stderr(), $($arg)*);
        r.expect("failed printing to stderr");
    } }
);

struct Scanner {
   buffer : std::collections::VecDeque<String>
}

impl Scanner {

   fn new() -> Scanner {
      Scanner {
         buffer: std::collections::VecDeque::new()
      }
   }

   fn process(&mut self) -> String {
      if self.buffer.len() == 0 {
         let mut input = String::new();
         std::io::stdin().read_line(&mut input).ok();
         for word in input.split_whitespace() {
            self.buffer.push_back(word.to_string())
         }
      }

      self.buffer.pop_front().unwrap()
   }

   #[allow(dead_code)]
   fn next<T : std::str::FromStr >(&mut self) -> T {
      self.process().parse::<T>().ok().unwrap()
   }

   #[allow(dead_code)]
   fn next_char(&mut self) -> char {
      self.process().into_bytes()[0] as char
   }
}

fn main() {
    let mut sin = Scanner::new();
    let mut n = sin.next();
    let mut result = vec![];
    result.push(1);
    n -= 1;
    let mut k = 2;
    let mut i = 0;

    while result[i] < n && n >= k {
        result.push(k);
        n -= k;
        k += 1;
        i += 1;
    }

    result[i] += n;

    println!("{}", result.len());
    print!("{}", result[0]);
    for j in result.iter().skip(1) {
        print!(" {}", *j);
    }
}


use std::cmp::max;
use std::cmp::min;
use std::io;
use std::io::Stdin;

fn read_line(stdin : &Stdin, line : &mut String) {
    match stdin.read_line(line) {
        Ok(_) => return,
        Err(msg) => panic!("Could not read line! Message: {}.", msg),
    }
}

fn read_file(c : char) -> i64 {
    if c == 'a' {
        1
    } else if c == 'b' {
        2
    } else if c == 'c' {
        3
    } else if c == 'd' {
        4
    } else if c == 'e' {
        5
    } else if c == 'f' {
        6
    } else if c == 'g' {
        7
    } else if c == 'h' {
        8
    } else {
        panic!("Unknown file: {}", c);
    }
}

fn read_rank(c : char) -> i64 {
    c.to_digit(10).unwrap() as i64
}

fn read_square(stdin : &Stdin) -> (i64, i64) {
    let mut line = String::new();
    read_line(&stdin, &mut line);
    let mut cs = line.trim().chars();
    let x = read_file(cs.next().unwrap());
    let y = read_rank(cs.next().unwrap());
    (x, y)
}

fn get_moves(d_x : i64, d_y : i64) -> (String, String) {
    let move_d;
    let move_s;
    let abs_d_x = d_x.abs();
    let abs_d_y = d_y.abs();
    if d_x < 0 {
        if d_y < 0 {
            move_d = String::from("LD");
            if abs_d_x < abs_d_y {
                move_s = String::from("D");
            } else if abs_d_x == abs_d_y {
                move_s = String::from("");
            } else {
                move_s = String::from("L");
            }
        } else if d_y == 0 {
            move_d = String::from("");
            move_s = String::from("L");
        } else {
            move_d = String::from("LU");
            if abs_d_x < abs_d_y {
                move_s = String::from("U");
            } else if abs_d_x == abs_d_y {
                move_s = String::from("");
            } else {
                move_s = String::from("L");
            }
        }
    } else if d_x == 0 {
        if d_y < 0 {
            move_s = String::from("D");
        } else if d_y == 0 {
            move_s = String::from("");
        } else {
            move_s = String::from("U");
        }
        move_d = String::from("");
    } else {
        if d_y < 0 {
            move_d = String::from("RD");
            if abs_d_x < abs_d_y {
                move_s = String::from("D");
            } else if abs_d_x == abs_d_y {
                move_s = String::from("");
            } else {
                move_s = String::from("R");
            }
        } else if d_y == 0 {
            move_s = String::from("R");
            move_d = String::from("");
        } else {
            move_d = String::from("RU");
            if abs_d_x < abs_d_y {
                move_s = String::from("U");
            } else if abs_d_x == abs_d_y {
                move_s = String::from("");
            } else {
                move_s = String::from("R");
            }
        }
    }
    (move_d, move_s)
}

fn print_path(s_x : i64, s_y : i64, t_x : i64, t_y : i64) {
    let d_x = t_x - s_x;
    let d_y = t_y - s_y;
    let abs_d_x = d_x.abs();
    let abs_d_y = d_y.abs();
    let n = max(abs_d_x, abs_d_y);
    let m = min(abs_d_x, abs_d_y);
    let (diagonal_move, straight_move) = get_moves(d_x, d_y);
    println!("{}", n);
    for _ in 0 .. m {
        println!("{}", diagonal_move);
    }
    for _ in 0 .. (n - m) {
        println!("{}", straight_move);
    }
}

fn main() {
    let stdin = io::stdin();
    let (s_x, s_y) = read_square(&stdin);
    let (t_x, t_y) = read_square(&stdin);
    print_path(s_x, s_y, t_x, t_y);
}


struct Scan {
    buffer: std::collections::VecDeque<String>,
}

impl Scan {
    fn new() -> Scan {
        Scan {
            buffer: std::collections::VecDeque::new(),
        }
    }

    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop_front() {
                break token.parse::<T>().ok().unwrap();
            }
            let mut line = String::new();
            std::io::stdin().read_line(&mut line).expect("Fail to read");
            self.buffer = line.split_whitespace().map(String::from).collect();
        }
    }
}

fn _main() {
    let mut scan = Scan::new();
    let sent: String = scan.next();
    let received: String = scan.next();
    let mut pos: isize = 0;
    for mov in sent.chars() {
        if mov == '+' {
            pos += 1;
        } else if mov == '-' {
            pos -= 1;
        }
    }
    let mut new_pos: isize = 0;
    let mut unknown: isize = 0;
    for mov in received.chars() {
        if mov == '+' {
            new_pos += 1;
        } else if mov == '-' {
            new_pos -= 1;
        } else {
            unknown += 1;
        }
    }
    let needed = pos - new_pos;
    if needed > unknown {
        println!("{:.10}", 0.0f64);
    } else {
        let total: usize = 2usize.pow(unknown as u32);
        let mut valid = 0isize;
        for i in 0..total {
            if (2 * i.count_ones() as isize - unknown as isize) == needed {
                valid += 1;
            }
        }
        let result = (valid as f64) / (total as f64);
        println!("{:.10}", result);
    }
}

fn main() {
    std::thread::Builder::new()
        .stack_size(1 << 23)
        .spawn(_main)
        .unwrap()
        .join()
        .unwrap();
}


//! http://codeforces.com/contest/265/problem/A

fn main() {
  use std::io;
  let mut buf = String::new();
  io::stdin().read_line(&mut buf).unwrap();
  let s = buf.trim().to_string();
  buf.clear();
  io::stdin().read_line(&mut buf).unwrap();
  let t = buf.trim().to_string();
  let ss = s.as_bytes();

  let mut i = 1;
  for &u in t.as_bytes() {
    if u == ss[i-1] { i += 1; }
  }
  println!("{}", i);
}


use std::io::stdin;
use std::vec::Vec;
use std::convert::From;

fn main() {
    let mut mat : Vec<Vec<char>> = vec![];
    for i in 0..6 {
        let mut input = "".to_string();
        stdin().read_line(&mut input).unwrap();
        mat.push(input.trim().chars().collect());
    }

    let idxs = vec![3, 4, 11, 12, 0, 1, 6, 7, 8, 9, 14, 15, 19, 20, 27, 28, 16, 17, 22, 23, 24, 25, 30, 31, 35, 36, 43, 44, 32, 33, 38, 39, 40, 41, 46, 47];

    for idx in idxs {
        if mat[idx / 8][idx % 8] == '.' {
            mat[idx / 8][idx % 8] = 'P';
            break
        }
    }

    for line in mat {
        for ch in line {
            print!("{}", ch);
        }
        println!();
    }
}


#![allow(unused_imports)]
use std::io;
use std::io::prelude::*;
use std::io::BufReader;
use std::str::FromStr;
use std::collections::{VecDeque, HashMap};

fn main() {
    let stdin = io::stdin();
    let mut input = stdin.lock();
    let mut line = String::new();
    input.read_line(&mut line).unwrap();
    let n = get_numbers::<usize>(&line)[0];
    line.clear();
    input.read_line(&mut line).unwrap();
    let arr = get_numbers::<usize>(&line);

    let min_i = arr.iter().position(|&v| v == 1).unwrap();
    let max_i = arr.iter().position(|&v| v == n).unwrap();

    let d_min = f64::abs(min_i as f64 - ((n-1) as f64 / 2.0)); // distance to center
    let d_max = f64::abs(max_i as f64 - ((n-1) as f64 / 2.0));

    // pick closest to center to move
    let d = if d_min < d_max {
        if min_i < max_i { // move min to 0
            max_i
        } else {
            (n-1)-max_i // move min to end
        }
    } else {
        if max_i < min_i {
            min_i
        } else {
            (n-1)-min_i
        }
    };

    println!("{}", d);
}

/*
 * Utility Functions
 */

// get numbers from line seperated by spaces
fn get_numbers<T>(line: &str) -> Vec<T>
    where T: FromStr,
          <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    line.split_whitespace()
        .map(|chunk| chunk.parse::<T>().expect("failed to parse"))
        .collect()
}


use std::io;
use std::str;

pub struct Scanner<R> {
    reader: R,
    buffer: Vec<String>,
}

impl<R: io::BufRead> Scanner<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buffer: vec![],
        }
    }

    pub fn token<T: str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            self.reader.read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn get_mpf(n: u64) -> u64 {
    let mut d = 2;
    while d * d <= n {
        if n % d == 0 {
            return d;
        }
        d += 1;
    }
    n
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let n: u64 = scan.token();
    let mpf = get_mpf(n);
    let ans;
    if mpf % 2 != 0 {
        if n == mpf {
            ans = 1;
        } else {
            ans = 1 + (n - mpf) / get_mpf(n - mpf);
        }
    } else {
        ans = n / mpf;
    }
    writeln!(out, "{}", ans).ok();
}

fn main() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());
    solve(&mut scan, &mut out);
}


use std::collections::VecDeque;

fn main() {
    let m: i32 = get_input().split_ascii_whitespace().last().unwrap().parse().unwrap();
    let children: Vec<i32> = get_input().split_ascii_whitespace().map(|v| v.parse().unwrap()).collect();

    let candies: Vec<Candy> = children.iter().enumerate().map(|(index, value)| {
        let candy = Candy::new(*value, index + 1);
        candy
    }).collect();

    let mut stack = VecDeque::new();

    for candy in candies {
        stack.push_back(candy);
    };

    while stack.len() > 1 {
        let next = stack.pop_front().unwrap();
        let temp = next.value - m;

        if temp > 0 {
            stack.push_back(Candy::new(temp, next.index));
        }
    }

    println!("{}", stack.pop_front().unwrap().index);
}

fn get_input() -> String {
    let mut buffer = String::new();
    std::io::stdin().read_line(&mut buffer).expect("Failed");
    buffer.trim().to_owned()
}

fn get_input_usize() -> usize {
    get_input().parse().unwrap()
}

#[derive(Debug)]
struct Candy {
    value: i32,
    index: usize,
}

impl Candy {
    pub fn new(value: i32, index: usize) -> Self {
        Candy {
            value,
            index
        }
    }
}


#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, [graph1; $len:expr]) => {{
        let mut g = vec![vec![]; $len];
        let ab = read_value!($next, [(usize1, usize1)]);
        for (a, b) in ab {
            g[a].push(b);
            g[b].push(a);
        }
        g
    }};
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
    ($next:expr, usize1) => (read_value!($next, usize) - 1);
    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        read_value!($next, [$t; len])
    }};
    ($next:expr, $t:ty) => ($next().parse::<$t>().expect("Parse error"));
}

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

/// Verified by https://atcoder.jp/contests/arc093/submissions/3968098
mod mod_int {
    use std::ops::*;
    pub trait Mod: Copy { fn m() -> i64; }
    #[derive(Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
    pub struct ModInt<M> { pub x: i64, phantom: ::std::marker::PhantomData<M> }
    impl<M: Mod> ModInt<M> {
        // x >= 0
        pub fn new(x: i64) -> Self { ModInt::new_internal(x % M::m()) }
        fn new_internal(x: i64) -> Self {
            ModInt { x: x, phantom: ::std::marker::PhantomData }
        }
        pub fn pow(self, mut e: i64) -> Self {
            debug_assert!(e >= 0);
            let mut sum = ModInt::new_internal(1);
            let mut cur = self;
            while e > 0 {
                if e % 2 != 0 { sum *= cur; }
                cur *= cur;
                e /= 2;
            }
            sum
        }
        #[allow(dead_code)]
        pub fn inv(self) -> Self { self.pow(M::m() - 2) }
    }
    impl<M: Mod, T: Into<ModInt<M>>> Add<T> for ModInt<M> {
        type Output = Self;
        fn add(self, other: T) -> Self {
            let other = other.into();
            let mut sum = self.x + other.x;
            if sum >= M::m() { sum -= M::m(); }
            ModInt::new_internal(sum)
        }
    }
    impl<M: Mod, T: Into<ModInt<M>>> Sub<T> for ModInt<M> {
        type Output = Self;
        fn sub(self, other: T) -> Self {
            let other = other.into();
            let mut sum = self.x - other.x;
            if sum < 0 { sum += M::m(); }
            ModInt::new_internal(sum)
        }
    }
    impl<M: Mod, T: Into<ModInt<M>>> Mul<T> for ModInt<M> {
        type Output = Self;
        fn mul(self, other: T) -> Self { ModInt::new(self.x * other.into().x % M::m()) }
    }
    impl<M: Mod, T: Into<ModInt<M>>> AddAssign<T> for ModInt<M> {
        fn add_assign(&mut self, other: T) { *self = *self + other; }
    }
    impl<M: Mod, T: Into<ModInt<M>>> SubAssign<T> for ModInt<M> {
        fn sub_assign(&mut self, other: T) { *self = *self - other; }
    }
    impl<M: Mod, T: Into<ModInt<M>>> MulAssign<T> for ModInt<M> {
        fn mul_assign(&mut self, other: T) { *self = *self * other; }
    }
    impl<M: Mod> Neg for ModInt<M> {
        type Output = Self;
        fn neg(self) -> Self { ModInt::new(0) - self }
    }
    impl<M> ::std::fmt::Display for ModInt<M> {
        fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
            self.x.fmt(f)
        }
    }
    impl<M: Mod> ::std::fmt::Debug for ModInt<M> {
        fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
            let (mut a, mut b, _) = red(self.x, M::m());
            if b < 0 {
                a = -a;
                b = -b;
            }
            write!(f, "{}/{}", a, b)
        }
    }
    impl<M: Mod> From<i64> for ModInt<M> {
        fn from(x: i64) -> Self { Self::new(x) }
    }
    // Finds the simplest fraction x/y congruent to r mod p.
    // The return value (x, y, z) satisfies x = y * r + z * p.
    fn red(r: i64, p: i64) -> (i64, i64, i64) {
        if r.abs() <= 10000 {
            return (r, 1, 0);
        }
        let mut nxt_r = p % r;
        let mut q = p / r;
        if 2 * nxt_r >= r {
            nxt_r -= r;
            q += 1;
        }
        if 2 * nxt_r <= -r {
            nxt_r += r;
            q -= 1;
        }
        let (x, z, y) = red(nxt_r, r);
        (x, y - q * z, z)
    }
} // mod mod_int

macro_rules! define_mod {
    ($struct_name: ident, $modulo: expr) => {
        #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
        struct $struct_name {}
        impl mod_int::Mod for $struct_name { fn m() -> i64 { $modulo } }
    }
}
const MOD: i64 = 1_000_000_007;
define_mod!(P, MOD);
type ModInt = mod_int::ModInt<P>;

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (let _ = write!(out,$($format)*););
    }
    input! {
        k: usize, pa: i64, pb: i64,
    }
    let mut dp = vec![vec![ModInt::new(0); k + 1]; k + 1];
    let pa = ModInt::new(pa);
    let pb = ModInt::new(pb);
    let pab = pa + pb;
    let pabinv = pab.inv();
    for i in (0..k).rev() {
        dp[i][k] = pa * pb.inv() + ModInt::new((i + k) as i64);
        for j in (1..k).rev() {
            let mut val = dp[i][j + 1] * pa;
            if i + j < k {
                val += dp[min(k, i + j)][j] * pb;
            } else {
                val += pb * ModInt::new((i + j) as i64);
            }
            dp[i][j] = val * pabinv;
        }
        let val = dp[i][1];
        dp[i][0] = val;
    }
    puts!("{}\n", dp[0][0]);
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


use std::collections::HashMap;
use std::io;

fn main() {
    const BLOBS: &'static str = "RBYG";

    let mut failure_count: HashMap<usize, usize> = HashMap::new();
    let mut pattern_position: HashMap<char, usize> = HashMap::new();

    let mut garland = String::new();

    io::stdin().read_line(&mut garland).unwrap();

    for (index, blob) in garland.chars().enumerate() {
        let position = index % BLOBS.len();
        match blob {
            '!' => {
                *failure_count.entry(position).or_insert(0) += 1;
            },
            x => {
                pattern_position.insert(x, position);
            }
        }
    }

    for blob in BLOBS.chars() {
        match pattern_position.get(&blob) {
            Some(position) => {
                print!("{} ", *failure_count.entry(*position).or_insert(0));
            },
            None => {
                println!("Cannot infer position of {} from input", blob);
            }
        }
    }
}


use std::io::{stdin, stdout, BufWriter, Write};

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>,
}
impl Scanner {
    #[inline]
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn gcd(mut a: u64, mut b: u64) -> u64 {
    while b != 0 {
        let tmp = b;
        b = a % b;
        a = tmp;
    }
    a
}

fn lcm(a: u64, b: u64) -> u64 {
    let gcd_ab = gcd(a, b);
    a / gcd_ab * b / gcd_ab
}

fn main() {
    let mut scan = Scanner::default();
    let out = &mut BufWriter::new(stdout());
    let n = scan.next::<u64>();
    let mut mx = n;
    let mut p = 1;
    let mut i = 2;
    while i * i <= n {
        if n % i == 0 {
            let b = n / i;
            if lcm(i, b) == n && b < mx {
                p = i;
                mx = b;
            }
        }
        i += 1;
    }
    writeln!(out, "{} {}", p, mx).ok();
}


#[allow(unused_imports)]
use std::cmp::{max,min};

macro_rules! readln {
    () => {{
        use std::io;

        let mut buf = String::new();
        io::stdin().read_line(&mut buf).unwrap();
        buf.trim().to_string()
    }};
    ( $t:ty ) => {{
        let input = readln!();
        input.parse::<$t>().unwrap()
    }};
    ( $( $t:ty ),+ ) => {{
        let input = readln!();
        let mut input = input.split_whitespace();
        (
            $(
                input.next().unwrap().parse::<$t>().unwrap(),
            )+
        )
    }}
}

macro_rules! readvec {
    ( $t:ty ) => {{
        let input = readln!();
        let mut input = input.split_whitespace();
        let mut result = Vec::new();
        for elem in input {
            result.push(elem.parse::<$t>().unwrap());
        }
        result
    }}
}

fn main() {
    let (n,x) = readln!(i64,i64);
    let mut res = 0;
    for i in 1..(n+1) {
        if x%i == 0 && x/i <= n{
            res += 1;
        }
    }
    println!("{}",res);
}


// ---------- begin ModInt ----------
const MOD: u32 = 1_000_000_007;

#[derive(Clone, Copy)]
struct ModInt(u32);

impl std::ops::Add for ModInt {
    type Output = ModInt;
    fn add(self, rhs: ModInt) -> Self::Output {
        let mut d = self.0 + rhs.0;
        if d >= MOD {
            d -= MOD;
        }
        ModInt(d)
    }
}

impl std::ops::AddAssign for ModInt {
    fn add_assign(&mut self, rhs: ModInt) {
        *self = *self + rhs;
    }
}

impl std::ops::Sub for ModInt {
    type Output = ModInt;
    fn sub(self, rhs: ModInt) -> Self::Output {
        let mut d = self.0 + MOD - rhs.0;
        if d >= MOD {
            d -= MOD;
        }
        ModInt(d)
    }
}

impl std::ops::SubAssign for ModInt {
    fn sub_assign(&mut self, rhs: ModInt) {
        *self = *self - rhs;
    }
}

impl std::ops::Mul for ModInt {
    type Output = ModInt;
    fn mul(self, rhs: ModInt) -> Self::Output {
        ModInt((self.0 as u64 * rhs.0 as u64 % MOD as u64) as u32)
    }
}

impl std::ops::MulAssign for ModInt {
    fn mul_assign(&mut self, rhs: ModInt) {
        *self = *self * rhs;
    }
}

impl std::ops::Neg for ModInt {
    type Output = ModInt;
    fn neg(self) -> Self::Output {
        ModInt(if self.0 == 0 {0} else {MOD - self.0})
    }
}

/*
impl std::fmt::Display for ModInt {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.0)
    }
}
*/

#[allow(dead_code)]
impl ModInt {
    pub fn new(n: u32) -> ModInt {
        ModInt(n % MOD)
    }
    pub fn zero() -> ModInt {
        ModInt(0)
    }
    pub fn one() -> ModInt {
        ModInt(1)
    }
    pub fn pow(self, mut n: u32) -> ModInt {
        let mut t = ModInt::one();
        let mut s = self;
        while n > 0 {
            if n & 1 == 1 {
                t *= s;
            }
            s *= s;
            n >>= 1;
        }
        t
    }
    pub fn inv(self) -> ModInt {
        self.pow(MOD - 2)
    }
}
// ---------- end ModInt ----------
// ---------- begin Precalc ----------
#[allow(dead_code)]
struct Precalc {
    inv: Vec<ModInt>,
    fact: Vec<ModInt>,
    ifact: Vec<ModInt>,
}

#[allow(dead_code)]
impl Precalc {
    pub fn new(n: usize) -> Precalc {
        let mut inv = vec![ModInt::one(); n + 1];
        let mut fact = vec![ModInt::one(); n + 1];
        let mut ifact = vec![ModInt::one(); n + 1];
        for i in 2..(n + 1) {
            inv[i] = -inv[MOD as usize % i] * ModInt(MOD / i as u32);
            fact[i] = fact[i - 1] * ModInt(i as u32);
            ifact[i] = ifact[i - 1] * inv[i];
        }
        Precalc {
            inv: inv,
            fact: fact,
            ifact: ifact,
        }
    }
    pub fn inv(&self, n: usize) -> ModInt {
        self.inv[n]
    }
    pub fn fact(&self, n: usize) -> ModInt {
        self.fact[n]
    }
    pub fn ifact(&self, n: usize) -> ModInt {
        self.ifact[n]
    }
    pub fn comb(&self, n: usize, k: usize) -> ModInt {
        if k > n {
            return ModInt::zero();
        }
        self.fact[n] * self.ifact[k] * self.ifact[n - k]
    }
}
// ---------- end Precalc ----------

fn run() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let n: usize = s.trim().parse().unwrap();
    let mut len = 0;
    while (2 << len) <= n {
        len += 1;
    }
    let mut cnt = vec![0; len + 2];
    for i in 0..=len {
        cnt[i] = n / (1 << i);
    }
    let mut dp = vec![ModInt::zero(); len + 2];
    dp[len] = ModInt::one();
    for i in 1..n {
        let mut next = vec![ModInt::zero(); len + 2];
        for j in 0..len {
            if cnt[j] > i {
                next[j] += dp[j] * ModInt((cnt[j] - i) as u32);
                next[j] += dp[j + 1] * ModInt((cnt[j] - cnt[j + 1]) as u32);
            }
        }
        dp = next;
    }
    let mut ans = dp[0];
    if (1 << len) / 2 * 3 <= n {
        let len = len - 1;
        let mut cnt = vec![vec![0; len + 2]; 2];
        for i in 0..=len {
            cnt[0][i] = n / (1 << i);
            cnt[1][i] = n / (1 << i) / 3;
        }
        let mut dp = vec![vec![ModInt::zero(); len + 2]; 2];
        dp[1][len] = ModInt::one();
        for i in 1..n {
            let mut next = vec![vec![ModInt::zero(); len + 2]; 2];
            for j in 0..=len {
                if cnt[0][j] > i {
                    next[0][j] += dp[0][j] * ModInt((cnt[0][j] - i) as u32);
                    next[0][j] += dp[1][j] * ModInt((cnt[0][j] - cnt[1][j]) as u32);
                    next[0][j] += dp[0][j + 1] * ModInt((cnt[0][j] - cnt[0][j + 1]) as u32);
                }
                if cnt[1][j] > i {
                    next[1][j] += dp[1][j] * ModInt((cnt[1][j] - i) as u32);
                    next[1][j] += dp[1][j + 1] * ModInt((cnt[1][j] - cnt[1][j + 1]) as u32);
                }
            }
            dp = next;
        }
        ans += dp[0][0];
    }
    println!("{}", ans.0);
}

fn main() {
    run();
}


#![allow(non_snake_case, unused_imports, deprecated, dead_code)]

// Input macros
macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); let mut next = || { iter.next().unwrap() }; input_inner!{next, $($r)*} }; ($($r:tt)*) => { let stdin = std::io::stdin(); let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next = move || -> String{ bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect() }; input_inner!{next, $($r)*} }; }
macro_rules! input_inner { ($next:expr) => {}; ($next:expr, ) => {}; ($next:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($next, $t); input_inner!{$next $($r)*} }; ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => { let mut $var = read_value!($next, $t); input_inner!{$next $($r)*} }; }
macro_rules! read_value { ($next:expr, ( $($t:tt),* )) => { ( $(read_value!($next, $t)),* ) }; ($next:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() }; ($next:expr, [ $t:tt ]) => { { let len = read_value!($next, usize); (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() } }; ($next:expr, chars) => { read_value!($next, String).chars().collect::<Vec<char>>() }; ($next:expr, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

// Module
use std::cmp::{min,max};
use std::collections::{VecDeque,HashMap,HashSet,BTreeMap,BTreeSet,BinaryHeap};
// Module for v1.15.1
use std::ascii::AsciiExt; // deprecated since 1.26.0: use inherent method instead

// Functions

// Main
fn main() {

    input! {
        N: usize,
        T: usize,
        mut S: chars
    }

    for _ in 0..T {
        let mut ci = vec![];
        for i in 0..N-1 {
            if S[i]=='B' && S[i+1]=='G' {
                ci.push(i);
            }
        }
        for i in ci {
            S[i]   = 'G';
            S[i+1] = 'B';
        }
    }

    println!("{}", S.iter().collect::<String>());
}


use std::io;
use std::io::Write;

/**************************************************

    START OF TEMPLATE CODE

 *************************************************/
#[allow(unused_macros)]
macro_rules! dbg {
    ($first_val:expr, $($val:expr),+ $(,)?) => {
        eprint!("[{}:{}] {} = {:?}",
                    file!(), line!(), stringify!($first_val), &$first_val);
        ($(eprint!(", {} = {:?}", stringify!($val), &$val)),+,);
        eprintln!();
    };
    ($first_val:expr) => {
        eprintln!("[{}:{}] {} = {:?}",
                    file!(), line!(), stringify!($first_val), &$first_val);
    };
}

enum InputSource {
    Stdin,
    FromFile(Vec<String>),
}

struct Scanner {
    buffer: Vec<String>,
    input_source: InputSource,
}

impl Scanner {
    #[allow(dead_code)]
    fn new() -> Self {
        Self { buffer: vec![], input_source: InputSource::Stdin }
    }

    #[allow(dead_code)]
    fn new_file(filename: &str) -> Self {
        let file = std::fs::read_to_string(filename).unwrap();
        let mut lines: Vec<String> = file.lines().map(|line| String::from(line)).collect();
        lines.reverse();
        Self { buffer: vec![], input_source: InputSource::FromFile(lines) }
    }

    #[allow(dead_code)]
    fn i64(&mut self) -> i64 {
        self.next::<i64>()
    }

    #[allow(dead_code)]
    fn i32(&mut self) -> i32 {
        self.next::<i32>()
    }

    #[allow(dead_code)]
    fn usize(&mut self) -> usize {
        self.next::<usize>()
    }

    #[allow(dead_code)]
    fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.next::<T>()).collect()
    }

    fn parse_next_line(&mut self) -> bool {
        let mut input = String::new();
        match &mut self.input_source {
            | InputSource::Stdin => {
                if std::io::stdin().read_line(&mut input).expect("Failed read") == 0 {
                    return false;
                }
            }
            | InputSource::FromFile(lines) => {
                match lines.pop() {
                    Some(line) => input = line,
                    None => return false,
                }
            }
        }

        self.buffer = input.split_whitespace().rev().map(String::from).collect();
        return true;
    }

    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }

            self.parse_next_line();
        }
    }

    #[allow(dead_code)]
    fn has_more_elements(&mut self) -> bool {
        loop {
            if !self.buffer.is_empty() {
                return true;
            }
            if !self.parse_next_line() {
                return false;
            }
        }
    }

    #[allow(dead_code)]
    fn string(&mut self) -> Vec<u8> {
        self.next::<String>().into_bytes()
    }
}

mod modulo {
    const MODULO: i32 = 998244353;

    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Mod(i32);

    impl Mod {
        #[allow(unused)]
        pub const ZERO: Self = Self(0);

        #[allow(unused)]
        pub const ONE: Self = Self(1);

        fn rev_rec(a: i32, m: i32) -> i32 {
            if a == 1 {
                return a;
            }
            return ((1 - Self::rev_rec(m % a, a) as i64 * m as i64) / a as i64 + m as i64) as i32;
        }

        #[allow(dead_code)]
        fn inv(self) -> Mod {
            Mod(Self::rev_rec(self.0, MODULO))
        }

        #[allow(dead_code)]
        pub fn new(mut x: i32) -> Self {
            if x < 0 {
                x += MODULO;
            } else if x >= MODULO {
                x -= MODULO;
            }
            assert!(0 <= x && x < MODULO);
            Self(x)
        }
    }

    impl std::fmt::Display for Mod {
        fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
            write!(f, "{}", self.0)
        }
    }

    impl std::fmt::Debug for Mod {
        fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
            const MAX: usize = 100;
            if self.0 <= MAX as i32 {
                write!(f, "{}", self.0)
            } else if self.0 >= MODULO - MAX as i32 {
                write!(f, "-{}", MODULO - self.0)
            } else {
                for denum in 1..MAX {
                    for num in 1..MAX {
                        if Mod(num as i32) / Mod(denum as i32) == *self {
                            return write!(f, "{}/{}", num, denum);
                        }
                    }
                }
                write!(f, "(?? {} ??)", self.0)
            }
        }
    }

    impl std::ops::Add for Mod {
        type Output = Mod;

        fn add(self, rhs: Self) -> Self::Output {
            let res = self.0 + rhs.0;
            if res >= MODULO {
                Mod(res - MODULO)
            } else {
                Mod(res)
            }
        }
    }

    impl std::ops::AddAssign for Mod {
        fn add_assign(&mut self, rhs: Self) {
            self.0 += rhs.0;
            if self.0 >= MODULO {
                self.0 -= MODULO;
            }
        }
    }

    impl std::ops::Sub for Mod {
        type Output = Mod;

        fn sub(self, rhs: Self) -> Self::Output {
            let res = self.0 - rhs.0;
            if res < 0 {
                Mod(res + MODULO)
            } else {
                Mod(res)
            }
        }
    }

    impl std::ops::SubAssign for Mod {
        fn sub_assign(&mut self, rhs: Self) {
            self.0 -= rhs.0;
            if self.0 < 0 {
                self.0 += MODULO;
            }
        }
    }

    impl std::ops::Mul for Mod {
        type Output = Mod;

        fn mul(self, rhs: Self) -> Self::Output {
            let res = (self.0 as i64) * (rhs.0 as i64) % (MODULO as i64);
            Mod(res as i32)
        }
    }

    impl std::ops::MulAssign for Mod {
        fn mul_assign(&mut self, rhs: Self) {
            self.0 = ((self.0 as i64) * (rhs.0 as i64) % (MODULO as i64)) as i32;
        }
    }

    impl std::ops::Div for Mod {
        type Output = Mod;

        fn div(self, rhs: Self) -> Self::Output {
            let rhs_inv = rhs.inv();
            self * rhs_inv
        }
    }

    impl std::ops::DivAssign for Mod {
        fn div_assign(&mut self, rhs: Self) {
            *self *= rhs.inv();
        }
    }
}

use modulo::*;

/**************************************************

    END OF TEMPLATE CODE

 *************************************************/

pub fn main() {
    let stdout = io::stdout();
    let mut out = std::io::BufWriter::new(stdout.lock());
    let mut sc = Scanner::new();

    let n = sc.usize();
    let mut res = vec![Mod::ZERO; n + 1];
    for delta in 1..=n {
        for sum in (delta..=n).step_by(delta) {
            res[sum] += Mod::ONE;
        }
    }
    let mut sum = Mod::ZERO;
    for i in 0..=n {
        res[i] += sum;
        sum += res[i];
    }
    writeln!(out, "{}", res[n]).unwrap();
}


#[allow(unused_imports)]
use std::cmp::{min,max};
//const INF: i32 = 0x3f3f3f3f;

struct Scanner {
    buffer: std::collections::VecDeque<String>
}

impl Scanner {
    fn new() -> Scanner {
        Scanner {
            buffer: std::collections::VecDeque::new()
        }
    }

    fn next<T: std::str::FromStr>(&mut self) -> T {
        while self.buffer.is_empty() {
            let mut input = String::new();
            std::io::stdin().read_line(&mut input).ok();
            self.buffer = input.split_whitespace()
                .map(ToString::to_string).collect();
        }
        let front = self.buffer.pop_front().unwrap();
        front.parse::<T>().ok().unwrap()
    }
}

fn gcd(a: i64, b: i64) -> i64 {
    if b == 0 {
        return a
    }
    else {
        return gcd(b, a % b);
    }
}

fn main1() {
    let mut scan = Scanner::new();
    let n = scan.next::<i64>();
    let k = scan.next::<i64>();
    let a = scan.next::<i64>();
    let b = scan.next::<i64>();
    let len = n * k;

    // all offsets are in [0, k]
    let mut offsets = vec![a+b, max(a,b)-min(a,b)];
    let neg1 = k - offsets[0];
    let neg2 = k - offsets[1];
    offsets.push(neg1);
    offsets.push(neg2);

    let mut lo = len;
    let mut hi = 0;
    for offset in offsets {
        for i in 0..n {
            let l = offset + k * i;
            let stops = len / gcd(l, len);
            lo = min(lo, stops);
            hi = max(hi, stops);
        }
    }
    println!("{} {}", lo, hi);
}

fn main() {
    std::thread::Builder::new().stack_size(50 << 20)
        .spawn(main1).unwrap().join().unwrap();
}


#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;$n:expr) => {
        (0..$n).map(|_| scan!()).collect::<Vec<_>>()
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (w1, h1, w2, h2) = scan!(i64, i64, i64, i64);
    println!("{}", w1 + 2 * h1 + 4 + w2 + 2 * h2 + w1 - w2);
}


#![allow(unused_imports)]
use std::io;
use std::io::prelude::*;
use std::io::BufReader;
use std::str::FromStr;
use std::collections::{VecDeque, HashMap};
use std::ops::Sub;

fn main() {
    let stdin = io::stdin();
    let mut input = stdin.lock();
    let mut line = String::new();
    input.read_line(&mut line).unwrap();
    let x = get_numbers(&line)[0];
    line.clear(); input.read_line(&mut line).unwrap();
    let nums = get_numbers(&line);

    let get_up = Time::new(nums[0], nums[1]);

    let mut snoozed = 0;
    let mut cur_time = get_up;
    while cur_time.lucky() == false {
        cur_time = cur_time - x;
        snoozed += 1;
        //println!("{} -> {}:{}", snoozed, cur_time.hh, cur_time.mm);
    }

    println!("{}", snoozed);
}

#[derive(Debug, Clone, Copy)]
struct Time {
    hh: u8,
    mm: u8,
}

impl Time {
    fn new(hour: u8, min: u8) -> Time {
        Time {
            hh: hour,
            mm: min,
        }
    }

    fn lucky(&self) -> bool {
        // 7 cannot be appear in the 10s spot so we only have to check ones
        self.mm % 10 == 7 || self.hh % 10 == 7
    }
}

impl Sub<u8> for Time {
    type Output = Time;

    fn sub(self, mins: u8) -> Time {
        if mins <= self.mm {
            Time { hh: self.hh, mm: self.mm - mins }
        } else if self.hh >= 1 {
            Time { hh: self.hh - 1, mm: self.mm + 60 - mins }
        } else {
            // going back a day
            Time { hh: 23, mm: self.mm + 60 - mins }
        }
    }
}

/*
 * Utility Functions
 */

// get numbers from line seperated by spaces
fn get_numbers<T>(line: &str) -> Vec<T>
    where T: FromStr,
          <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    line.split_whitespace()
        .map(|chunk| chunk.parse::<T>().expect("failed to parse"))
        .collect()
}


use std::io;

fn solve(n :i32, x :i32, numbers :&Vec<i32>) -> i32 {
    let mut r = 0;
    for elem in numbers.iter() {
        if elem > &x {
            break;
        } else if elem < &x {
            r = r + 1;
        } else {
            r = r - 1;
        }
    }
    x - r
}

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input).expect("io error");
    let arr: Vec<i32> = input.trim_right().split_whitespace().map(|x| {
        let r: i32 = x.parse().expect("not a number");
        r
    }).collect();
    let n = arr[0];
    let x = arr[1];
    input.clear();
    io::stdin().read_line(&mut input).expect("io error");
    let mut numbers: Vec<i32> = input.trim_right().split_whitespace().map(|x| {
        let r: i32 = x.parse().expect("not a number");
        r
    }).collect();
    numbers.sort();
    println!("{}", solve(n, x, numbers.as_ref()));
}


#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_imports)]
use std::io::stdin;
mod util {
    use std::io::stdin;
    use std::str::FromStr;
    use std::fmt::Debug;
    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }
    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }
}
#[allow(unused_macros)]
macro_rules ! get { ( $ t : ty ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . trim ( ) . parse ::<$ t > ( ) . unwrap ( ) } } ; ( $ ( $ t : ty ) ,* ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; let mut iter = line . split_whitespace ( ) ; ( $ ( iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) , ) * ) } } ; ( $ t : ty ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ ( $ t : ty ) ,*; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ ( $ t ) ,* ) ) . collect ::< Vec < _ >> ( ) } ; ( $ t : ty ;; ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . split_whitespace ( ) . map ( | t | t . parse ::<$ t > ( ) . unwrap ( ) ) . collect ::< Vec < _ >> ( ) } } ; }
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { println ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) ; } }

use std::cmp::Reverse;

fn main() {
    let mut aa: Vec<char> = util::line().chars().collect();
    let bb: Vec<char> = util::line().chars().collect();

    let mut amap = HashMap::new();
    let mut bmap = HashMap::new();

    for &a in &aa {
        *amap.entry(a).or_insert(0) += 1;
    }

    for &b in &bb {
        *bmap.entry(b).or_insert(0) += 1;
    }

    if amap == bmap {
        println!(
            "{}",
            bb.iter()
                .map(|x| x.to_string())
                .collect::<Vec<_>>()
                .join("")
        );
        return;
    }

    if aa.len() < bb.len() {
        aa.sort_by_key(|&x| Reverse(x));
        println!(
            "{}",
            aa.iter()
                .map(|x| x.to_string())
                .collect::<Vec<_>>()
                .join("")
        );
        return;
    }

    let ans = (0..aa.len())
        .filter_map(|i| {
            let mut res = Vec::new();
            let mut amap = amap.clone();

            for &b in &bb[..i] {
                let c = amap.entry(b).or_insert(0);
                if *c > 0 {
                    *c -= 1;
                    res.push(b);
                } else {
                    return None;
                }
            }

            if let Some((&x, _)) = amap.iter().filter(|&(&k, &v)| v > 0 && k < bb[i]).max() {
                res.push(x);
                *amap.entry(x).or_insert(0) -= 1;
            } else {
                return None;
            }

            let mut rest = Vec::new();
            for (&k, &v) in amap.iter() {
                for _ in 0..v {
                    rest.push(k);
                }
            }

            rest.sort_by_key(|&x| Reverse(x));

            res.append(&mut rest);

            Some(res)
        })
        .max()
        .unwrap();

    println!(
        "{}",
        ans.iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join("")
    );
}


// https://codeforces.com/problemset/problem/750/A
use std::io;

fn cumulative(n: i64) -> i64 {
    let mut sum = 0;
    for i in 1..n+1 {
        sum += i*5;
    }
    sum
}

fn main() {
    let mut line = String::new();

    io::stdin()
        .read_line(&mut line)
        .unwrap();

    let words: Vec<i64> =
        line
        .split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect();

    let n = words[0];
    let k = words[1];

    let mut left = 0;
    let mut right = n;

    while left <= right {
        let middle = (right+left)/2;
        if (cumulative(middle)+k) <= 240 {
            left = middle+1;
        } else {
            right = middle-1;
        }
    }
    println!("{}", right);
}


#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::*;
#[allow(dead_code)]
fn getline() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    return ret;
}
fn get_word() -> String {
    let mut stdin = std::io::stdin();
    let mut u8b: [u8; 1] = [0];
    loop {
        let mut buf: Vec<u8> = Vec::with_capacity(16);
        loop {
            let res = stdin.read(&mut u8b);
            if res.unwrap_or(0) == 0 || u8b[0] <= b' ' {
                break;
            } else {
                buf.push(u8b[0]);
            }
        }
        if buf.len() >= 1 {
            let ret = std::string::String::from_utf8(buf).unwrap();
            return ret;
        }
    }
}
fn parse<T: std::str::FromStr>(s: &str) -> T { s.parse::<T>().ok().unwrap() }

#[allow(dead_code)]
fn get<T: std::str::FromStr>() -> T { parse(&get_word()) }

fn main() {
    let k: i64 = get();
    let a: i64 = get();
    let b: i64 = get();
    let aq = a / k;
    let bq = b / k;
    let res: i64 = if (aq == 0 && b % k != 0) || (bq == 0 && a % k != 0) {
        -1
    } else {
        a / k + b / k
    };
    println!("{}", res);
}


#![allow(unused_imports, unused_variables, dead_code, non_snake_case, unused_macros)]
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;
fn getline() -> String {
    let mut res = String::new();
    std::io::stdin().read_line(&mut res).ok();
    res
}
macro_rules ! readl { ( $ t : ty ) => { { let s = getline ( ) ; s . trim ( ) . parse ::<$ t > ( ) . unwrap ( ) } } ; ( $ ( $ t : ty ) ,+ ) => { { let s = getline ( ) ; let mut iter = s . trim ( ) . split ( ' ' ) ; ( $ ( iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) , ) * ) } } ; }
macro_rules ! readlvec { ( $ t : ty ) => { { let s = getline ( ) ; let iter = s . trim ( ) . split ( ' ' ) ; iter . map ( | x | x . parse ( ) . unwrap ( ) ) . collect ::< Vec <$ t >> ( ) } } }
macro_rules ! mvec { ( $ v : expr , $ s : expr ) => { vec ! [ $ v ; $ s ] } ; ( $ v : expr , $ s : expr , $ ( $ t : expr ) ,* ) => { vec ! [ mvec ! ( $ v , $ ( $ t ) ,* ) ; $ s ] } ; }
macro_rules ! debug { ( $ x : expr ) => { println ! ( "{}: {:?}" , stringify ! ( $ x ) , $ x ) } }
fn printiter<'a, T>(v: &'a T)
where
    &'a T: std::iter::IntoIterator,
    <&'a T as std::iter::IntoIterator>::Item: std::fmt::Display,
{
    for (i, e) in v.into_iter().enumerate() {
        if i != 0 {
            print!(" ");
        }
        print!("{}", e);
    }
    println!("");
}
struct ContestPrinter {
    s: String,
}
impl ContestPrinter {
    fn new() -> ContestPrinter {
        ContestPrinter { s: String::new() }
    }
    fn print<T>(&mut self, x: T)
    where
        T: std::fmt::Display,
    {
        self.s.push_str(format!("{}", x).as_str());
    }
    fn println<T>(&mut self, x: T)
    where
        T: std::fmt::Display,
    {
        self.s.push_str(format!("{}\n", x).as_str());
    }
}
impl std::ops::Drop for ContestPrinter {
    fn drop(&mut self) {
        print!("{}", self.s);
    }
}
static MOD: i64 = 1e9 as i64 + 7;
fn is_max_i64(num: i64) -> bool {
    if num == i64::max_value() {
        true
    } else {
        false
    }
}
fn main() {
    let mut pr = ContestPrinter::new();
    let N = readl!(usize);
    let s = readl!(String);
    let sc = s.chars().collect::<Vec<char>>();
    let mut idx = 1;
    let mut ans = 1;
    if N == 1 {
        pr.println(1);
        return;
    }
    while idx < N {
        if ((sc[idx - 1] == 'R') & (sc[idx] == 'U')) |
           ((sc[idx - 1] == 'U') & (sc[idx] == 'R')) {
            idx += 1;
        }
        idx += 1;
        if idx <= N  { ans += 1; }
    }
    pr.println(ans);
}


use std::io;
fn main(){
    let mut s:String=String::new();
    io::stdin().read_line(&mut s).unwrap();
    let mut c:usize=0;
    let mut n:usize=0;
    let mut a:Vec<i32>=Vec::new();
    while c<s.len()-1{
        n=c;
        if s.chars().nth(c).unwrap()!=' '{
            while s.chars().nth(n).unwrap()!=' ' && n<s.len()-1{
                n+=1;
            }
            a.push(s[c..n].trim().to_string().parse().unwrap());
            c=n;
        }
        c+=1;
    }
    let a=a[1];
    let mut s:String=String::new();
    io::stdin().read_line(&mut s).unwrap();
    n=0;
    c=0;
    let mut b:Vec<i32>=Vec::new();
    while c<s.len()-1{
        n=c;
        if s.chars().nth(c).unwrap()!=' '{
            while s.chars().nth(n).unwrap()!=' ' && n<s.len()-1{
                n+=1;
            }
            b.push(s[c..n].trim().to_string().parse().unwrap());
            c=n;
        }
        c+=1;
    }
    let mut n:i32=a;
    for c in 0..b.len(){
        if n>a/b[c] && a%b[c]==0{
            n=a/b[c];
        }
    }
    println!("{}",n)
}


use std::io;
use std::str;

fn count_bits(n: u64) -> u64 {
    let mut n = n;
    let mut ans = 0;
    while n > 0 {
        ans += 1;
        n >>= 1;
    }
    ans
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let n: u64 = scan.token();
    let k: u64 = scan.token();
    // Maximize the xor-sum of at most k numbers from 1 to n
    // For any bit pattern that represents a positive number, its negation is always less than the number itself.
    // For example, n = 6 = 110 -> neg(n) = 001
    // n ^ neg(n) = 111
    // The answer is num_bits(n) ones, if k >= 2
    if k == 1 {
        writeln!(out, "{}", n).ok();
        return;
    }
    let num_bits = count_bits(n);
    let mut ans = 0u64;
    for i in 0..(num_bits) {
        ans = ans | (1 << i);
    }
    writeln!(out, "{}", ans).ok();
}

fn main() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());
    solve(&mut scan, &mut out);
}

pub struct Scanner<R> {
    reader: R,
    buffer: Vec<String>,
}

impl<R: io::BufRead> Scanner<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buffer: vec![],
        }
    }

    pub fn token<T: str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            self.reader.read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }

    pub fn tokens<T: str::FromStr>(&mut self) -> Vec<T> {
        assert!(self.buffer.is_empty());
        let mut input = String::new();
        self.reader.read_line(&mut input).expect("Failed read");
        input
            .split_whitespace()
            .map(|x| x.parse().ok().expect("Failed parse"))
            .collect()
    }
}


//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//

fn run() {
    input! {
        a: usize,
        b: usize,
        c: usize,
    }
    if a <= std::cmp::min(b, c) {
        println!("Yes");
    } else {
        println!("No");
    }
}

fn main() {
    run();
}


//! http://codeforces.com/contest/80/problem/A

#[macro_export]
macro_rules! scanln {
  ($($var:ident : $ty:path),+) => {
    $(let $var: $ty;)+
    {
      use std::io;
      let mut __buf = String::new();
      io::stdin().read_line(&mut __buf).unwrap();
      let mut eles = __buf.split_whitespace();
      $($var = Scan::scan(&mut eles);)+
    }
  }
}

pub trait Scan {
  fn scan<'a, I>(eles: &mut I) -> Self where I: Iterator<Item=&'a str>;
}

macro_rules! impl_scan_single {
  ($ty:ty) => {
    impl Scan for $ty {
      fn scan<'a, I>(eles: &mut I) -> Self where I: Iterator<Item=&'a str> {
        let next = eles.next().unwrap();
        match next.parse() {
          Ok(res) => res,
          Err(_) => panic!()
        }
      }
    }
  }
}

impl_scan_single!(u8);
impl_scan_single!(u16);
impl_scan_single!(u32);
impl_scan_single!(u64);
impl_scan_single!(usize);
impl_scan_single!(i8);
impl_scan_single!(i16);
impl_scan_single!(i32);
impl_scan_single!(i64);
impl_scan_single!(f32);
impl_scan_single!(f64);
impl_scan_single!(isize);
impl_scan_single!(String);

const __IMPL_SCAN_FOR_VEC: () = {
  use std::str::FromStr;
  impl<T> Scan for Vec<T> where T: FromStr {
    fn scan<'a, I>(eles: &mut I) -> Self where I: Iterator<Item=&'a str> {
      eles.map(|str| match str.parse() {
        Ok(res) => res,
        Err(_) => panic!()
      }).collect()
    }
  }
};

// -----------------------------------------------------------------------------

fn main() {
  let mut sieve = vec![true; 51];
  for i in 2..50 {
    let mut j = 2 * i;
    while j < 51 {
      sieve[j] = false;
      j += i;
    }
  }
  scanln!(n: usize, m: usize);
  let mut next_prime = n;
  for i in n+1..51 {
    if sieve[i] { next_prime = i; break; }
  }
  if next_prime == m {
    println!("YES");
  } else {
    println!("NO");
  }
}


#![allow(unused_macros)]
#![allow(unused_mut)]

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io;
use std::io::Write;
use std::str;
#[allow(unused_imports)]
use std::prelude::*;

// credit tanakh input macro
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

// credit ebtech scanner
pub struct UnsafeScanner<R> {
    reader: R,
    buf_str: Vec<u8>,
    buf_iter: str::SplitAsciiWhitespace<'static>,
}

impl<R: io::BufRead> UnsafeScanner<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buf_str: vec![],
            buf_iter: "".split_ascii_whitespace(),
        }
    }

    /// This function should be marked unsafe, but noone has time for that in a
    /// programming contest. Use at your own risk!
    pub fn token<T: str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buf_iter.next() {
                return token.parse().ok().expect("Failed parse");
            }
            self.buf_str.clear();
            self.reader
                .read_until(b'\n', &mut self.buf_str)
                .expect("Failed read");
            self.buf_iter = unsafe {
                let slice = str::from_utf8_unchecked(&self.buf_str);
                std::mem::transmute(slice.split_ascii_whitespace())
            }
        }
    }
}

fn solve() {
    #[allow(unused_variables)]
    let (stdin, stdout) = (io::stdin(), io::stdout());
    //let mut scan = UnsafeScanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());

    input! {
        a: usize,
        s: String,
    }
    let mut v = Vec::new();
    for c in s.chars() {
        v.push(c);
    }

    if a == 1 { writeln!(out, "{}", 0).ok();}
    else {
        let mut op = 0;
        for i in 0..(v.len() - 1) {
            if v[i] == v[i+1] {
                op += 1;
            }
        }
        writeln!(out, "{}", op).ok();
    }

}

// credit kobae964
fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, StdoutLock, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , bytes ) => { read_value ! ( $ next , String ) . into_bytes ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }
#[allow(dead_code)]
pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
    let out = stdout();
    let writer = BufWriter::new(out.lock());
    f(writer)
}
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) } ; }
#[allow(dead_code)]
fn main() {
    input!{
        w: i64,
        h: i64,
        u1: i64,
        d1: i64,
        u2: i64,
        d2: i64,
    }
    let mut ans = w;
    let mut height = h;
    while height > 0 {
        ans += height;
        if d1 == height {
            ans -= u1;
        }
        if d2 == height {
            ans -= u2;
        }
        if ans < 0 {
            ans = 0;
        }
        height -= 1;
    }
    println!("{}", ans);
}


#[allow(unused_imports)]
use std::cmp::{max,min};
#[allow(unused_imports)]
use std::collections::{HashMap,HashSet,VecDeque};

#[allow(unused_macros)]
macro_rules! readln {
    () => {{
        use std::io;

        let mut buf = String::new();
        io::stdin().read_line(&mut buf).unwrap();
        buf.trim().to_string()
    }};
    ( $t:ty ) => {{
        let input = readln!();
        input.parse::<$t>().unwrap()
    }};
    ( $( $t:ty ),+ ) => {{
        let input = readln!();
        let mut input = input.split_whitespace();
        (
            $(
                input.next().unwrap().parse::<$t>().unwrap(),
            )+
        )
    }}
}

#[allow(unused_macros)]
macro_rules! readvec {
    ( $t:ty ) => {{
        let input = readln!();
        let mut input = input.split_whitespace();
        let mut result = Vec::new();
        for elem in input {
            result.push(elem.parse::<$t>().unwrap());
        }
        result
    }}
}

fn main() {
    let mut s = String::from("A");
    s += readln!().as_ref();
    s += "A";
    let v : Vec<usize> = s.chars().enumerate().filter(|&(i,c)|c=='A' || c=='E' || c=='I' || c=='O' || c=='U' || c=='Y').map(|(i,c)|i).collect();
    let u : usize = v.iter().skip(1).zip(v.iter()).map(|(i,j)|i-j).max().unwrap();
    println!("{}",u);
}


use std::io::{self};

fn is_paly(x: i32) -> bool {
    let h = (x / 60) % 24;
    let m = x % 60;
    h % 10 * 10 + h / 10 == m
}

fn find_paly(x: i32) -> i32 {
    for i in x..3000{
        if is_paly(i) {return i - x}
    }
    -1
}

fn read_time() -> Result<i32, String> {
    let mut str = String::new();
    try!(io::stdin().read_line(&mut str).map_err(|e| e.to_string()));
    let parts: Vec<&str> = str.split(':').collect();
    if parts.len() != 2  { return Err(String::from("wrong format, should have single : delimiter")) };
    let x = try!(parts[0].trim().parse::<i32>().map_err(|e|e.to_string()));
    let y = try!(parts[1].trim().parse::<i32>().map_err(|e|e.to_string()));
    Ok(x * 60 + y)
}

fn main() {
    let tt = read_time().unwrap();
    print!("{}", find_paly(tt));
}


struct Scan {
    buffer: std::collections::VecDeque<String>,
}

impl Scan {
    fn new() -> Scan {
        Scan {
            buffer: std::collections::VecDeque::new(),
        }
    }

    fn next_line(&self) -> String {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).expect("Fail to read");
        line
    }

    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop_front() {
                break token.parse::<T>().ok().unwrap();
            }
            let line = self.next_line();
            self.buffer = line.split_whitespace().map(String::from).collect();
        }
    }
}

fn _main() {
    let mut scan = Scan::new();
    let n: usize = scan.next();
    println!(
        "{}",
        match n {
            11..=19 | 21 => {
                4
            }
            20 => {
                15
            }
            _ => {
                0
            }
        }
    );
}

fn main() {
    std::thread::Builder::new()
        .stack_size(1 << 23)
        .spawn(_main)
        .unwrap()
        .join()
        .unwrap();
}


#![allow(non_snake_case, unused_imports, deprecated, dead_code)]

// Input macros
macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); let mut next = || { iter.next().unwrap() }; input_inner!{next, $($r)*} }; ($($r:tt)*) => { let stdin = std::io::stdin(); let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next = move || -> String{ bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect() }; input_inner!{next, $($r)*} }; }
macro_rules! input_inner { ($next:expr) => {}; ($next:expr, ) => {}; ($next:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($next, $t); input_inner!{$next $($r)*} }; ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => { let mut $var = read_value!($next, $t); input_inner!{$next $($r)*} }; }
macro_rules! read_value { ($next:expr, ( $($t:tt),* )) => { ( $(read_value!($next, $t)),* ) }; ($next:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() }; ($next:expr, [ $t:tt ]) => { { let len = read_value!($next, usize); (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() } }; ($next:expr, chars) => { read_value!($next, String).chars().collect::<Vec<char>>() }; ($next:expr, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

// Module
use std::cmp::{min,max};
use std::collections::{VecDeque,HashSet,HashMap,BinaryHeap};
// Module for v1.15.1
use std::ascii::AsciiExt; // deprecated since 1.26.0: use inherent method instead

// Functions

// Main
fn main() {

    input! {
        N: chars,
    }

    let mut ans = "YES";
    let mut cnt_4 = 0;

    // 最上位は 1 必須
    if N[0] != '1' {
        ans = "NO";
    } else {
        for i in 1..N.len() {
            if N[i] == '1' {
                cnt_4 = 0;
                continue;
            // 4 は連続2回まで
            } else if N[i] == '4' {
                cnt_4 += 1;
                if cnt_4 > 2 {
                    ans = "NO";
                    break;
                }
            } else {
                ans = "NO";
                break;
            }
        }
    }
    println!("{}", ans);
}


use std::collections::HashSet;
fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s);
    let s = s.trim();

    let count: HashSet<_> = s.chars().collect();
    if count.contains(&'H') || count.contains(&'Q') || count.contains(&'9') {
        println!("YES");
    } else {
        println!("NO");
    }
}


#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, BinaryHeap, VecDeque, BTreeSet, BTreeMap};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_imports)]
use std::io::stdin;

mod util {
    use std::io::stdin;
    use std::str::FromStr;
    use std::fmt::Debug;

    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }

    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }
}

#[allow(unused_macros)]
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    get!($t)
                   ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    get!($($t),*)
                   ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn f(i: usize, k: u64, ll: &Vec<u64>) -> char {
    let mut i = i;
    let mut k = k;

    loop {
        if i == 0 {
            let f0 = "What are you doing at the end of the world? Are you busy? Will you save us?";
            return if f0.len() as u64 > k {
                f0.chars().nth(k as usize).unwrap()
            } else {
                '.'
            };
        } else {
            if k < 34 {
                let s1 = "What are you doing while sending \"";
                return s1.chars().nth(k as usize).unwrap();
            } else if k < 34 + ll[i - 1] {
                // f(i - 1, k - 34, ll)
                i -= 1;
                k -= 34;
            } else if k < 34 + ll[i - 1] + 32 {
                let s2 = "\"? Are you busy? Will you send \"";
                return s2.chars().nth((k - 34 - ll[i - 1]) as usize).unwrap();
            } else if k < 34 + ll[i - 1] + 32 + ll[i - 1] {
                // f(i - 1, k - 34 - ll[i - 1] - 32, ll)
                k -= 34 + ll[i - 1] + 32;
                i -= 1;
            } else if k < 34 + ll[i - 1] + 32 + ll[i - 1] + 2 {
                let s3 = "\"?";
                return s3.chars()
                    .nth((k - 34 - ll[i - 1] - 32 - ll[i - 1]) as usize)
                    .unwrap();
            } else {
                return '.';
            }
        }
    }

}

fn main() {
    let k_max: u64 = 1000000000000000000;

    let mut ll = Vec::new();
    ll.push(75u64);
    let mut n = 0;
    for i in 1..100001 {
        n = ll[i - 1] * 2 + 68;
        ll.push(n);
        if n > k_max {
            break;
        }
    }
    while ll.len() < 100001 {
        ll.push(n);
    }

    let mut ans = Vec::new();

    let n = get!(usize);

    for _ in 0..n {
        let (n, k) = get!(usize, u64);
        ans.push(f(n, k - 1, &ll));
    }

    println!("{}", ans.into_iter().collect::<String>());
}


//spnauti-rust
#[allow(unused_macros)]
macro_rules! a {
    ($c: tt, $x: expr, $y: expr) => {{
        let b = $y; let a = &mut $x;
        if b $c *a { *a = b; true } else { false }
    }};
}
use std::io::*;
use std::str::*;
use std::fmt::Debug;
struct WordReader<'a> { it : SplitAsciiWhitespace<'a>, }
#[allow(dead_code)]
impl<'a> WordReader<'a> {
    fn new<T: Read>(b: &mut String, mut r: T) -> WordReader {
        b.clear();
        r.read_to_string(b).unwrap();
        WordReader { it: b.split_ascii_whitespace() }
    }
    fn from_stdin(b: &mut String) -> WordReader {
        WordReader::new(b, stdin())
    }
    fn sl(&mut self) ->  &str { self.it.next().unwrap() }
    fn bs(&mut self) -> &[u8] { self.sl().as_bytes()    }
    fn s(&mut self) -> String { String::from(self.sl()) }
    fn i(&mut self) ->    i32 { self.p()                }
    fn u(&mut self) ->  usize { self.p()                }
    fn vi(&mut self, n: usize) -> Vec<i32> {
        self.vp::<i32>(n)
    }
    fn p<T: FromStr>(&mut self) -> T where T::Err: Debug {
        self.sl().parse::<T>().unwrap()
    }
    fn vp<T: FromStr>(&mut self, n: usize) -> Vec<T> where T::Err: Debug {
        (0..n).map(|_| self.p()).collect()
    }
}

fn main() {
    let mut bin = String::new();
    let mut input = WordReader::from_stdin(&mut bin);

    let n = input.u();
    let mut a = std::collections::HashMap::<i32,i32>::new();
    for _ in 0..n {
        let x = input.i();
        let k = 1 + if let Some(&k) = a.get(&x) { k } else { 0 };
        a.insert(x, k);
    }
    let sol = a.into_iter().map(|(_,k)| k).max().unwrap();
    println!("{}", sol);
}


#![allow(unused_imports)]
use std::io::*;
use std::cmp::*;
use std::collections::*;

macro_rules! debug(
    ($($arg:tt)*) => { {
        let r = writeln!(&mut ::std::io::stderr(), $($arg)*);
        r.expect("failed printing to stderr");
    } }
);

struct Scanner {
   buffer : std::collections::VecDeque<String>
}

impl Scanner {

   fn new() -> Scanner {
      Scanner {
         buffer: std::collections::VecDeque::new()
      }
   }

   fn process(&mut self) -> String {
      if self.buffer.len() == 0 {
         let mut input = String::new();
         std::io::stdin().read_line(&mut input).ok();
         for word in input.split_whitespace() {
            self.buffer.push_back(word.to_string())
         }
      }

      self.buffer.pop_front().unwrap()
   }

   fn next<T : std::str::FromStr >(&mut self) -> T {
      self.process().parse::<T>().ok().unwrap()
   }

   fn next_char(&mut self) -> char {
      self.process().into_bytes()[0] as char
   }
}

fn main() {
   let mut sin = Scanner::new();
   let (m, d) : (usize, i32) = (sin.next(), sin.next());

   let month_days = vec![31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

   let mut days = month_days[m-1];

   let mut columns = 1;
   days -= 7 - d + 1;

   while days > 7 {
      columns += 1;
      days -= 7;
   }

   if days > 0 {
      columns += 1;
   }

   println!("{}", columns);
}


//spnauti-rusT
use std::io::*;
use std::str::{self,*};
use std::fmt::Debug;
#[allow(unused_imports)] use std::cmp::Ordering::{self,*};
#[allow(unused_imports)] use std::ops::{self,*};
#[allow(unused_imports)] use std::iter::{self,*};
#[allow(unused_imports)] use std::collections::*;
#[allow(unused_macros)]
macro_rules! m {
    ($c:tt, $x:expr, $y:expr) => {{
        let b = $y; let a = &mut $x;
        if b $c *a { *a = b; true } else { false }
    }};
}
#[allow(unused_macros)]
macro_rules! l {
    ($($v:ident),* = $i:ident.$f:ident $a:tt) => {
        $( let $v = $i.$f$a; )*
    };
    ($($v:ident),*:$t:ty = $i:ident.$f:ident $a:tt) => {
        $( let $v:$t = $i.$f$a; )*
    };
}
struct WordReader<'a> { it : SplitAsciiWhitespace<'a> }
#[allow(dead_code)]
impl<'a> WordReader<'a> {
    fn new<T: Read>(b: &mut String, mut r: T) -> WordReader {
        b.clear();
        r.read_to_string(b).ok();
        WordReader { it: b.split_ascii_whitespace() }
    }
    fn from_stdin(b: &mut String) -> WordReader {
        WordReader::new(b, stdin())
    }
    fn sl(&mut self) ->  &str { self.it.next().unwrap() }
    fn bs(&mut self) -> &[u8] { self.sl().as_bytes()    }
    fn s(&mut self) -> String { String::from(self.sl()) }
    fn i(&mut self) ->    i32 { self.p()                }
    fn f(&mut self) ->    f64 { self.p()                }
    fn u(&mut self) ->  usize { self.p()                }
    fn sk(&mut self, n: usize) { self.it.nth(n - 1); }
    fn ii(&mut self, n: usize) -> impl Iterator<Item=i32> {
        self.ip(n).into_iter()
    }
    fn vi(&mut self, n: usize) -> Vec<i32> {
        self.vp::<i32>(n)
    }
    fn p<T: FromStr>(&mut self) -> T where T::Err: Debug {
        self.sl().parse::<T>().unwrap()
    }
    fn ip<T: FromStr>(&mut self, n: usize) -> impl Iterator<Item=T> where T::Err: Debug {
        self.vp(n).into_iter()
    }
    fn vp<T: FromStr>(&mut self, n: usize) -> Vec<T> where T::Err: Debug {
        (0..n).map(|_| self.p()).collect()
    }
}
//------------------- End rusT

fn main() {
    let mut bin = String::new();
    let mut input = WordReader::from_stdin(&mut bin);

    l!(a,b,c,d = input.i());
    let mut ans = false;
    let mut f = |x: i32, y: i32| {
        if x == y {
            ans = true;
        }
    };
    f(a, b+c+d);
    f(b, a+c+d);
    f(c, a+b+d);
    f(d, a+b+c);
    f(a+b, c+d);
    f(a+c, b+d);
    f(a+d, b+c);
    if ans {
        println!("YES");
    } else {
        println!("NO");
    }
}


use std::collections::HashMap;

fn main(){
    let cin = std::io::stdin();
    let mut mp = HashMap::with_capacity(10);
    let mut origs = String::new();
    cin.read_line(&mut origs)
        .expect("lol");
    for i in 0u32..11u32{
        let mut s = String::new();
        cin.read_line(&mut s)
            .expect("lol");
        mp.insert(String::from(s.trim()),i);
    }
    for i in 0..=7{
        let sl: &str = &origs[i*10..i*10+10];
        let s = String::from(sl);
        let val: &u32 = mp.get(&s).expect("");
        print!("{}",val);
    }
    println!("");
}


use std::io;

static ALPHABET: &str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

fn find_number_of_ops(length_of_string: usize, s: String) -> usize {
    let mut number_of_ops = vec![];
    for i in 0..length_of_string-3 {
        let substring = &s[i..i+4];
        let mut ops = 0;
        for (index_of_letter_in_substring, letter) in substring.chars().enumerate() {
            if letter != "ACTG".chars().nth(index_of_letter_in_substring).unwrap() {
                // number of operations is not zero for this letter
                let position_of_letter_in_alphabet = ALPHABET.find(letter).unwrap();
                let position_of_target_in_alphabet = ALPHABET.find("ACTG".chars().nth(index_of_letter_in_substring).unwrap()).unwrap();
                let x: usize = (position_of_letter_in_alphabet as isize - position_of_target_in_alphabet as isize).abs() as usize;
                let y: usize = 26 - (position_of_target_in_alphabet as isize - position_of_letter_in_alphabet as isize).abs() as usize;
                ops += if x < y {x} else {y};
            }
            if index_of_letter_in_substring == 3 {
                number_of_ops.push(ops);
            }
        }
    }
    let mut minimum_ops = number_of_ops[0];
    for ops in number_of_ops.iter() {
        if ops < &minimum_ops {
            minimum_ops = *ops;
        }
    }
    minimum_ops
}

fn main() {
    let mut length_of_string = String::new();
    io::stdin().read_line(&mut length_of_string).unwrap();
    let length_of_string: usize = length_of_string.trim().parse().unwrap();
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    println!("{}", find_number_of_ops(length_of_string, s.trim().to_string()));
}


use std::io::{self, prelude::*};

#[allow(unused_must_use)]
fn solve<B: BufRead, W: Write>(mut scan: Scanner<B>, mut w: W) {
    //let n = scan.token::<usize>();
    let mut input: Vec<char> = scan.token::<String>().chars().collect();
    input[0] = input[0].to_uppercase().nth(0).unwrap();
    let ans: String = input.into_iter().collect();
    writeln!(w, "{}", ans);
}

fn main() {
    let stdin = io::stdin();
    let stdout = io::stdout();
    let reader = Scanner::new(stdin.lock());
    let writer = io::BufWriter::new(stdout.lock());
    solve(reader, writer);
}

#[allow(dead_code)]
fn matrix_to_str<T: ToString>(matrix: &Vec<Vec<T>>, separator: &str) -> String {
    use std::fmt::Write;
    let mut ans = String::new();
    for line in matrix.iter() {
        for elem in line.iter() {
            write!(&mut ans, "{}{}", elem.to_string(), separator).unwrap();
        }
        write!(&mut ans, "\n").unwrap();
    }
    ans
}
pub struct Scanner<B> {
    reader: B,
    buf_str: Vec<u8>,
    buf_iter: std::str::SplitWhitespace<'static>,
}
impl<B: BufRead> Scanner<B> {
    pub fn new(reader: B) -> Self {
        Self {
            reader,
            buf_str: Vec::new(),
            buf_iter: "".split_whitespace()
        }
    }
    pub fn token<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buf_iter.next() {
                return token.parse().ok().expect("Failed parse");
            }
            self.buf_str.clear();
            self.reader.read_until(b'\n', &mut self.buf_str).expect("Failed read");
            self.buf_iter = unsafe {
                let slice = std::str::from_utf8_unchecked(&self.buf_str);
                std::mem::transmute(slice.split_whitespace()) }
        }
    }
    pub fn get_matrix<T: std::str::FromStr>(&mut self, m: usize, n: usize) -> Vec<Vec<T>> {
        // m rows and n columns
        let mut ans: Vec<Vec<T>> = Vec::with_capacity(m);
        for i in 0..m {
            ans.push(Vec::with_capacity(n));
            for _ in 0..n {
                ans[i].push(self.token::<T>());
            }
        }
        ans
    }
}