//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: v!([]), 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 = v!([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 board(&mut self, r: usize, c: Option<usize>) -> Vec<Vec<u8>> {
		let mut res = v!([r]);
		let c = c.unwrap_or(0);
		rep!{[r]
			let t = self.vb();
			assert!(c == 0 || t.len() == c);
			res.push(t);
		}
		res
	}
	fn framed_board(&mut self, r: usize, c: usize, f: u8) -> Vec<Vec<u8>> {
		let mut res = v!([r+2]);
		res.push( v!([c+2] = f) );
		rep!{[r]
			let mut t = self.vb();
			assert!(t.len() == c);
			t.reserve(2);
			t.insert(0,f);
			t.push(f);
			res.push(t);
		}
		res.push( v!([c+2] = f) );
		res
	}
	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()
	}
	fn graph(&mut self, n: usize, m: usize) -> Vec<Vec<usize>> {
		let mut e = v!([n][]); rep!{[m] l!(a,b = self.u()-1); e[a].push(b); e[b].push(a); } e
	}
	fn graph_w<T: Copy+FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<(usize,T)>> where T::Err: Debug {
		let mut e = v!([n][]); rep!{[m] l!(a,b = self.u()-1); let c: T = self.p(); e[a].push((b,c)); e[b].push((a,c)); } e
	}
}
//------------------- End rusT }}}

// Field (mod prime) {{{
mod field {
	use std::ops::*;
	#[allow(dead_code)] pub const Z0: Field = Field(0);
	#[allow(dead_code)] pub const Z1: Field = Field(1);
	const P5: i32 = 1_000_000_007;
	const P6: i64 = P5 as i64;
	#[derive(Debug,Clone,Copy,PartialEq,Eq,PartialOrd,Ord,Default)] pub struct Field(i32);
	#[allow(dead_code)] impl Field {
		pub fn new<T: Into<i64>>(a: T) -> Self { Self(Self::cv(a)) }
		pub fn new_unchecked(a: i32) -> Self { Self(a) }
		fn hi(mut a: i32) -> i32 { if a >= P5 { a -= P5; } a }
		fn lo(mut a: i32) -> i32 { if a < 0 { a += P5; } a }
		fn cv<T: Into<i64>>(a: T) -> i32 { Self::lo((a.into() % P6) as i32) }
		pub fn inv(self) -> Self { self.pow(P5-2) }
		pub fn pow<T: Into<i64>>(self, b: T) -> Self {
			let b = b.into(); if b == 0 { Self(1) } else {
				let mut res = self.pow(b/2); res *= res; if b % 2 == 1 {res *= self;} res
			}
		}
	}
	impl Add for Field { type Output = Self; fn add(self, a: Self) -> Self::Output { Self(Self::hi(self.0 + a.0)) }}
	impl Sub for Field { type Output = Self; fn sub(self, a: Self) -> Self::Output { Self(Self::lo(self.0 - a.0)) }}
	impl Mul for Field { type Output = Self; fn mul(self, a: Self) -> Self::Output { Self(Self::cv(self.0 as i64 * a.0 as i64)) }}
	impl Div for Field { type Output = Self; fn div(self, a: Self) -> Self::Output { self * a.inv() }}
	impl Neg for Field { type Output = Self; fn neg(self) -> Self::Output { Self(Self::lo(-self.0)) }}
	impl AddAssign for Field { fn add_assign(&mut self, a: Self) { *self = *self + a; } }
	impl SubAssign for Field { fn sub_assign(&mut self, a: Self) { *self = *self - a; } }
	impl MulAssign for Field { fn mul_assign(&mut self, a: Self) { *self = *self * a; } }
	impl DivAssign for Field { fn div_assign(&mut self, a: Self) { *self = *self / a; } }
	use std::fmt::{Display, Formatter, Result};
	impl Display for Field { fn fmt(&self, f: &mut Formatter) -> Result { write!(f, "{}", self.0) } }
}
#[allow(unused_imports)] use field::{Field, Field as Z, Z0, Z1};
//}}}
// Square Matrix (Field) {{{
type MatT = Field;
const MAT_T_0: MatT = Z0;
const MAT_T_1: MatT = Z1;
#[derive(Debug,Clone)] struct Mat { n: usize, a: Vec<MatT> }
#[allow(dead_code)] impl Mat {
	fn new(n:usize)->Self{Self{n,a:vec![MAT_T_0;n*n]}}
	fn diag(n:usize,v:MatT)->Self{let mut m=Self::new(n);let mut p=0;for _ in 0..n{m.a[p]=v;p+=n+1;}m}
	fn pow(&self,n:u64)->Self{if n==0{Self::diag(self.n,MAT_T_1)}else{let mut t=self.pow(n/2);t*=t.clone();if n%2==1{t*=self.clone();}t}}
	fn range(&self,r:Range<usize>,c:Range<usize>)->Vec<Vec<MatT>>{if r.start<r.end||c.start<c.end{Vec::new()}else{let mut res=vec![vec![MAT_T_0;c.end-c.start];r.end-r.start];
		for i in r.start..r.end{let ir=i-r.start;let ii=i*self.n+c.start;for j in 0..c.end-c.start{res[ir][j]=self.a[ii+j];}}res}}
	fn at(&self,r:usize,c:usize)->MatT{self.a[r*self.n+c]}
	fn at_mut<'a>(&'a mut self,r:usize,c:usize)->&'a mut MatT{&mut self.a[r*self.n+c]}//'
}
impl Mul for Mat{type Output=Self;fn mul(self,o:Self)->Self::Output{assert!(self.n==o.n);let n=self.n;let mut res=Self::new(n);
	for ii in(0..n).map(|i|i*n){for j in 0..n{let mut t=MAT_T_0;let mut kk=j;for k in 0..n{t+=self.a[ii+k]*o.a[kk];kk+=n;}res.a[ii+j]=t;}}res}}
impl Add for Mat{type Output=Self;fn add(mut self,o:Self)->Self{self+=o;self}}
impl Sub for Mat{type Output=Self;fn sub(mut self,o:Self)->Self{self-=o;self}}
impl MulAssign for Mat{fn mul_assign(&mut self,a:Self){*self=self.clone()*a;}}
impl AddAssign for Mat{fn add_assign(&mut self,o:Self){assert!(self.n==o.n);for(x,y)in self.a.iter_mut().zip(o.a.into_iter()){*x+=y;}} }
impl SubAssign for Mat{fn sub_assign(&mut self,o:Self){assert!(self.n==o.n);for(x,y)in self.a.iter_mut().zip(o.a.into_iter()){*x-=y;}} }
impl PartialEq for Mat{fn eq(&self,o:&Self)->bool{self.n==o.n&&self.a==o.a}}impl Eq for Mat{}
// }}}

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

	let n = rin.l();
	let m = rin.u();
	let mut mat = Mat::new(m);
	for i in 1..m {
		*mat.at_mut(i,i-1) = Z1;
	}
	*mat.at_mut(0,0) = Z1;
	*mat.at_mut(0,m-1) = Z1;
	let mat = mat.pow(n as u64);
	let sol = mat.at(0,0);
	writeln!(rout, "{}", sol).ok();
}


fn run() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let mut n: usize = s.trim().parse().unwrap();
    let mut ans = String::new();
    for k in 2..1000 {
        while n % k == 0 {
            ans.push_str(&format!("{}", k));
            n /= k;
        }
    }
    println!("{}", ans);
}

fn main() {
    run();
}


// {{{ by shik

use std::io;

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

#[allow(unused_macros)]
macro_rules! R {
    ( $ty:ty, ... ) => {
        gets().split_whitespace().map(|x| x.parse::<$ty>().unwrap()).collect::<Vec<_>>()
    };
    ( $($ty:ty),* ) => {{
        let line = gets();
        let mut it = line.split_whitespace();
        ( $(it.next().unwrap().parse::<$ty>().unwrap(),)* )
    }}
}

#[allow(unused_macros)]
macro_rules! W {
    ( $x:expr ) => {{
        println!("{}", $x);
    }};
    ( $x:expr, $($xs:expr),* ) => {{
        print!("{} ", $x);
        W!($($xs),*);
    }}
}

#[allow(unused_macros)]
macro_rules! join {
    ($x:expr, $($xs:expr),*; $sep:expr) => { concat!($x, $($sep, $xs),*) }
}

#[allow(unused_macros)]
macro_rules! dump {
    ($($x:expr),*) => {
        eprintln!(join!($(concat!(stringify!($x), " = {:?}")),*; ", "), $($x),*);
    }
}

// }}}

use std::cmp;

fn main() {
    let (n, ) = R!(i32);
    println!("{}", cmp::max(n, cmp::max(n/10, n/100*10+n%10)));
}


//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! {
        n: i64,
        p: i64,
    }
    for k in 1..50 {
        let v = n - p * k;
        if v < 0 {
            break;
        }
        let c = v.count_ones() as i64;
        if c <= k && k <= v {
            println!("{}", k);
            return;
        }
    }
    println!("-1");
}

fn main() {
    run();
}


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

struct Scanner<R> {
    reader: R,
    buf_str: Vec<u8>,
    buf_iter: str::SplitWhitespace<'static>,
}
impl<R: io::BufRead> Scanner<R> {
    fn new(reader: R) -> Self {
        Self { reader, buf_str: vec![], buf_iter: "".split_whitespace() }
    }
    fn token<T: str::FromStr>(&mut self) -> T {
        loop {
            // If we have another token in this line
            if let Some(token) = self.buf_iter.next() {
                return token.parse().ok().expect("Failed parse"); // calls parse::<T>() on the current token and returns it.
            }

            // If we do not have another token in the line then
            // we should go to the next line.
            self.buf_str.clear(); // empty out the buffer that holds the current line
            self.reader.read_until(b'\n', &mut self.buf_str).expect("Failed read"); // read a new line into the buffer

            // create an iterator over the white space delimited strings of the current line
            self.buf_iter = unsafe {
                let slice = str::from_utf8_unchecked(&self.buf_str); // makes a string from utf8 characters in the current line
                std::mem::transmute(slice.split_whitespace()) // transmutes the memory in place
            }
        }
    }
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let mut ans = "YES";
    for _ in 0..8 {
        let row = scan.token::<String>();
        if !alternates(row) {
            ans = "NO";
        }
    }
    writeln!(out, "{}", ans);
}

fn alternates(s: String) -> bool {
    s.chars().collect::<Vec<char>>().windows(2).all(|win| win[0] != win[1])
}

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::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, ( $($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);
        (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    }};

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

mod pollard_rho {
    use std::collections::HashMap;
    /// binary gcd
    pub fn gcd(mut x: i64, mut y: i64) -> i64 {
        if y == 0 { return x; }
        if x == 0 { return y; }
        let mut sh = 0;
        while ((x | y) & 1) == 0 {
            x >>= 1; y >>= 1; sh += 1;
        }
        while (x & 1) == 0 { x >>= 1; }
        while y != 0 {
            while (y & 1) == 0 { y >>= 1; }
            if x > y { let t = x; x = y; y = t; }
            y -= x;
        }
        x << sh
    }

    fn add_mod(x: i64, y: i64, n: i64) -> i64 {
        let z = x + y;
        if z >= n { z - n } else { z }
    }

    fn mul_mod(x: i64, mut y: i64, n: i64) -> i64 {
        assert!(x >= 0);
        assert!(x < n);
        let mut sum = 0;
        let mut cur = x;
        while y > 0 {
            if (y & 1) == 1 {
                sum = add_mod(sum, cur, n);
            }
            cur = add_mod(cur, cur, n);
            y >>= 1;
        }
        sum
    }

    fn mod_pow(x: i64, mut e: i64, n: i64) -> i64 {
        let mut prod = if n == 1 { 0 } else { 1 };
        let mut cur = x % n;
        while e > 0 {
            if (e & 1) == 1 {
                prod = mul_mod(prod, cur, n);
            }
            cur = mul_mod(cur, cur, n);
            e >>= 1;
        }
        prod
    }

    pub fn is_prime(n: i64) -> bool {
        if n <= 1 { return false; }
        let small = [2, 3, 5, 7, 11, 13];
        if small.iter().any(|&u| u == n) { return true; }
        if small.iter().any(|&u| n % u == 0) { return false; }
        let mut d = n - 1;
        let mut e = 0;
        while (d & 1) == 0 {
            d >>= 1;
            e += 1;
        }
        let a = [2, 325, 9375, 28178, 450775, 9780504, 1795265022];
        a.iter().all(|&a| {
            if a >= n { return true; }
            let mut x = mod_pow(a, d, n);
            if x == 1 { return true; }
            for _ in 0 .. e {
                if x == n - 1 {
                    return true;
                }
                x = mul_mod(x, x, n);
                if x == 1 { return false; }
            }
            x == 1
        })
    }

    fn pollard_rho(n: i64, c: &mut i64) -> i64 {
        if n % 2 == 0 { return 2; }
        loop {
            let mut x: i64 = 2;
            let mut y = 2;
            let mut d = 1;
            let cc = *c;
            let f = |i| add_mod(mul_mod(i, i, n), cc, n);
            while d == 1 {
                x = f(x);
                y = f(f(y));
                d = gcd((x - y).abs(), n);
            }
            if d == n {
                *c += 1;
                continue;
            }
            return d;
        }
    }

    /// Outputs (p, e) in p's ascending order.
    pub fn factorize(x: i64) -> Vec<(i64, usize)> {
        if x <= 1 {
            return Vec::new();
        }
        let mut hm = HashMap::new();
        let mut pool = vec![x];
        let mut c = 1;
        while let Some(u) = pool.pop() {
            if is_prime(u) {
                *hm.entry(u).or_insert(0) += 1;
                continue;
            }
            let p = pollard_rho(u, &mut c);
            pool.push(p);
            pool.push(u / p);
        }
        let mut v: Vec<_> = hm.into_iter().collect();
        v.sort();
        v
    }
} // mod pollard_rho

use pollard_rho::*;

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }
    input! {
        n: i64,
        b: i64,
    }
    let fac = factorize(b);
    let mut mi: i64 = 1 << 62;
    for (p, e) in fac {
        let mut tot = 0;
        let mut v = n;
        while v > 0 {
            v /= p;
            tot += v;
        }
        mi = min(mi, tot / e as i64);
    }
    puts!("{}\n", mi);
}

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();
}


//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! 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),+ =$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! vec_dim {
	([$d:expr]$($s:tt)+) => {vec![vec_dim!($($s)+);$d]}; (=$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();

	l!(mut n,a,b = rin.l());
	n *= 6;
	if a * b < n {
		let s = (n as f64).sqrt() as i64 + 10;
		let flip = a > b;
		let (a0,b0) = (a.min(b),a.max(b));
		a = a0.max(s);
		b = b0.max(s);
		for i in 1..=n {
			let j = (n + i - 1) / i;
			if i > j {
				break;
			}
			let a1 = a0.max(i);
			let b1 = b0.max(j);
			if a1 * b1 >= n && a1 * b1 < a * b {
				a = a1;
				b = b1;
			}
		}
		if flip {
			let c = a;
			a = b;
			b = c;
		}
	}
	writeln!(rout, "{}\n{} {}", a*b, a, b).ok();
}


// Try Codeforces
// author: Leonardone @ NEETSDKASU

fn solve(n: i64, m: i64, k: i64) -> (i64, i64) {

    if k < n {
        return (k + 1, 1);
    }

    let e = k - n;
    let r = e / (m - 1);
    let c = e % (m - 1);

    let y = n - r;
    let x = if r % 2 == 0 { c + 2 } else { m - c };

    return (y, x);
}

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 n = get!();
    let m = get!();
    let k = get!();

    if n * m < 20 {
        for e in 0..n*m {
            let (row, col) = solve(n, m, e);
            let (r, c) = brute_force(n, m, e);
            if row != r || col != c {
                //println!("error {} {} {}", n, m, e);
                //println!("solve {} {}", row, col);
                //println!("bf    {} {}", r, c);
                //panic!();
                break;
            }
        }
    }

    let (row, col) = solve(n, m, k);

    println!("{} {}", row, col);

}

fn brute_force(n: i64, m: i64, k: i64) -> (i64, i64) {
    let mut row = 1;
    let mut col = 1;
    let mut rem = k;

    if rem == 0 {
        return (row, col);
    }

    for _ in 0..n-1 {
        row += 1;
        rem -= 1;
        if rem == 0 {
            return (row, col);
        }
    }

    let mut state = 0;
    for _ in 0..rem {
        match state {
        0 => {
            col += 1;
            if col == m {
                state += 1;
            }
        },
        2 => {
            col -= 1;
            if col == 2 {
                state += 1;
            }
        },
        _ => {
            row -= 1;
            state = (state + 1) % 4;
        },
        }
    }
    return (row, col);
}


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

use std::io::prelude::*;
use std::io::BufReader;
use std::cmp::{max, min};

fn get_line() -> String {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    input
}

fn get_vec<T>() -> Vec<T>
where T: FromStr,
      <T as FromStr>::Err: std::fmt::Debug,
{
    get_line().split_whitespace().map(|k| k.parse().unwrap()).collect()
}

fn main() {
    let n: usize = get_line().trim().parse().unwrap();
    let x = get_line().trim().parse::<usize>().unwrap();

    // On a une permutation qui dépend de n.
    // Premières valeurs :
    // 2 1 3
    // 2 3 1
    // 3 2 1
    // 3 1 2
    // 1 3 2
    // 1 2 3

    let perm = |i, n| {
        match i {
            0 => (n + 1) % 6 / 2,
            1 => match n % 3 {
                0 => 1,
                1 => 0,
                2 => 2,
                _ => panic!("Something is WRONG."),
            },
            2 => (n + 4) % 6 / 2,
            _ => panic!("Something is WRONG."),
        }
    };

    let ans = perm(x, n);

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


#[allow(unused_imports)]
use std::cmp::{max, min};
use std::io::{stdin, stdout, BufWriter, Write};

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>,
}
impl Scanner {
    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 main() {
    let mut scan = Scanner::default();
    let out = &mut BufWriter::new(stdout());
    let n = scan.next::<u128>() / 2;

    let mut res = 1;

    for i in 1..n {
        res *= i;
        res *= i + n;
    }
    println!("{:?}", res);
}


use std::io;

fn main() {
    let mut word = String::new();
    io::stdin().read_line(&mut word)
        .expect("Failed to read line");

    let snums = word.trim().split("+");
    // let nums: Vec<i32> = word.split("+");
    //     // .map(|s| s.parse::<i32>().unwrap())
    //     // .collect();

    let mut nums = Vec::<i32>::new();
    for s in snums {
        let n = s.parse::<i32>().unwrap();
        nums.push(n);
    }

    nums.sort();

    match nums.pop() {
        Some(last) => {
            for n in nums {
                print!("{}+", n);
            }
            println!("{}", last);
        },
        None => println!("bad input")
    }

}


pub use __cargo_equip::prelude::*;

#[allow(unused_imports)]
#[cfg_attr(cargo_equip, cargo_equip::equip)]
use crate::__cargo_equip::crates::proconio::{marker::*, *};

/*#[allow(non_snake_case)]
#[fastout]
fn main() {
    input! {
        t: usize,
    }
    for _ in 0..t {
        input! {
            n: usize,
        }
        println!("{}", 2usize.pow(n as u32)-1);
    }
}*/
#[allow(non_snake_case)]
fn main() {
    let __proconio_stdout = ::std::io::stdout();
    let mut __proconio_stdout = ::std::io::BufWriter::new(__proconio_stdout.lock());
    #[allow(unused_macros)]
    macro_rules ! print { ($ ($ tt : tt) *) => { { use std :: io :: Write as _ ; :: std :: write ! (__proconio_stdout , $ ($ tt) *) . unwrap () ; } } ; }
    #[allow(unused_macros)]
    macro_rules ! println { ($ ($ tt : tt) *) => { { use std :: io :: Write as _ ; :: std :: writeln ! (__proconio_stdout , $ ($ tt) *) . unwrap () ; } } ; }
    let __proconio_res = {
        input! { t : usize , }
        for _ in 0..t {
            input! { n : usize , }
            println!("{}", 2usize.pow(n as u32) - 1);
        }
    };
    <::std::io::BufWriter<::std::io::StdoutLock> as ::std::io::Write>::flush(
        &mut __proconio_stdout,
    )
    .unwrap();
    return __proconio_res;
}

// The following code was expanded by `cargo-equip`.

///  # Bundled libraries
///
///  - `lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)` licensed under `MIT/Apache-2.0`    as `crate::__cargo_equip::crates::__lazy_static_1_4_0`
///  - `proconio 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)`    licensed under `MIT OR Apache-2.0` as `crate::__cargo_equip::crates::proconio`
///
///  # Procedural macros
///
///  - `proconio-derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)` licensed under `MIT OR Apache-2.0`
///
///  # License and Copyright Notices
///
///  - `lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)`
///
///      ```text
///      Copyright (c) 2010 The Rust Project Developers
///
///      Permission is hereby granted, free of charge, to any
///      person obtaining a copy of this software and associated
///      documentation files (the "Software"), to deal in the
///      Software without restriction, including without
///      limitation the rights to use, copy, modify, merge,
///      publish, distribute, sublicense, and/or sell copies of
///      the Software, and to permit persons to whom the Software
///      is furnished to do so, subject to the following
///      conditions:
///
///      The above copyright notice and this permission notice
///      shall be included in all copies or substantial portions
///      of the Software.
///
///      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
///      ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
///      TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
///      PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
///      SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
///      CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
///      OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
///      IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
///      DEALINGS IN THE SOFTWARE.
///      ```
///
///  - `proconio 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)`
///
///      ```text
///      The MIT License
///      Copyright 2019 (C) statiolake <statiolake@gmail.com>
///
///      Permission is hereby granted, free of charge, to any person obtaining a copy of
///      this software and associated documentation files (the "Software"), to deal in
///      the Software without restriction, including without limitation the rights to
///      use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
///      the Software, and to permit persons to whom the Software is furnished to do so,
///      subject to the following conditions:
///
///      The above copyright notice and this permission notice shall be included in all
///      copies or substantial portions of the Software.
///
///      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
///      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
///      FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
///      COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
///      IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
///      CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
///
///      Copyright for original `input!` macro is held by Hideyuki Tanaka, 2019.  The
///      original macro is licensed under BSD 3-clause license.
///
///      Redistribution and use in source and binary forms, with or without
///      modification, are permitted provided that the following conditions are met:
///
///      1. Redistributions of source code must retain the above copyright notice, this
///         list of conditions and the following disclaimer.
///
///      2. Redistributions in binary form must reproduce the above copyright notice,
///         this list of conditions and the following disclaimer in the documentation
///         and/or other materials provided with the distribution.
///
///      3. Neither the name of the copyright holder nor the names of its contributors
///         may be used to endorse or promote products derived from this software
///         without specific prior written permission.
///
///      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
///      ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
///      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
///      DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
///      FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
///      DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
///      SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
///      CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
///      OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
///      OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///      ```
#[allow(unused)]
mod __cargo_equip {
    pub(crate) mod crates {
        pub mod __lazy_static_1_4_0 {
            // Copyright 2016 lazy-static.rs Developers
            //
            // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
            // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
            // http://opensource.org/licenses/MIT>, at your option. This file may not be
            // copied, modified, or distributed except according to those terms.

            #![no_std]

            pub use crate::__cargo_equip::macros::__lazy_static_1_4_0::*;
            use crate::__cargo_equip::preludes::__lazy_static_1_4_0::*;
            #[path = "inline_lazy.rs"]

            pub mod lazy {
                // Copyright 2016 lazy-static.rs Developers
                //
                // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
                // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
                // http://opensource.org/licenses/MIT>, at your option. This file may not be
                // copied, modified, or distributed except according to those terms.

                use crate::__cargo_equip::preludes::__lazy_static_1_4_0::*;
                extern crate core;
                extern crate std;

                use self::std::cell::Cell;
                use self::std::hint::unreachable_unchecked;
                use self::std::prelude::v1::*;
                use self::std::sync::Once;
                #[allow(deprecated)]
                pub use self::std::sync::ONCE_INIT;

                // FIXME: Replace Option<T> with MaybeUninit<T> (stable since 1.36.0)
                pub struct Lazy<T: Sync>(Cell<Option<T>>, Once);

                impl<T: Sync> Lazy<T> {
                    #[allow(deprecated)]
                    pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT);

                    #[inline(always)]
                    pub fn get<F>(&'static self, f: F) -> &T
                    where
                        F: FnOnce() -> T,
                    {
                        self.1.call_once(|| {
                            self.0.set(Some(f()));
                        });

                        // `self.0` is guaranteed to be `Some` by this point
                        // The `Once` will catch and propagate panics
                        unsafe {
                            match *self.0.as_ptr() {
                                Some(ref x) => x,
                                None => {
                                    debug_assert!(false, "attempted to derefence an uninitialized lazy static. This is a bug");

                                    unreachable_unchecked()
                                }
                            }
                        }
                    }
                }

                unsafe impl<T: Sync> Sync for Lazy<T> {}

                #[macro_export]

                macro_rules! __cargo_equip_macro_def___lazy_static_1_4_0___lazy_static_create {
                    ($NAME:ident, $T:ty) => {
                        static $NAME:
                            $crate::__cargo_equip::crates::__lazy_static_1_4_0::lazy::Lazy<$T> =
                            $crate::__cargo_equip::crates::__lazy_static_1_4_0::lazy::Lazy::INIT;
                    };
                }
                macro_rules!__lazy_static_create{($($tt:tt)*)=>(crate::__cargo_equip_macro_def___lazy_static_1_4_0___lazy_static_create!{$($tt)*})}
            }

            pub use core::ops::Deref as __Deref;

            #[macro_export(local_inner_macros)]

            macro_rules! /*__lazy_static_internal*/__cargo_equip_macro_def___lazy_static_1_4_0___lazy_static_internal {
                // optional visibility restrictions are wrapped in `()` to allow for
                // explicitly passing otherwise implicit information about private items
                ($(#[$attr:meta])* ($($vis:tt)*) static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
                    __lazy_static_internal!(@MAKE TY, $(#[$attr])*, ($($vis)*), $N);
                    __lazy_static_internal!(@TAIL, $N : $T = $e);
                    lazy_static!($($t)*);
                };
                (@TAIL, $N:ident : $T:ty = $e:expr) => {
                    impl $crate::__cargo_equip::crates::__lazy_static_1_4_0::__Deref for $N {
                        type Target = $T;
                        fn deref(&self) -> &$T {
                            #[inline(always)]
                            fn __static_ref_initialize() -> $T { $e }

                            #[inline(always)]
                            fn __stability() -> &'static $T {
                                __lazy_static_create!(LAZY, $T);
                                LAZY.get(__static_ref_initialize)
                            }
                            __stability()
                        }
                    }
                    impl $crate::__cargo_equip::crates::__lazy_static_1_4_0::LazyStatic for $N {
                        fn initialize(lazy: &Self) {
                            let _ = &**lazy;
                        }
                    }
                };
                // `vis` is wrapped in `()` to prevent parsing ambiguity
                (@MAKE TY, $(#[$attr:meta])*, ($($vis:tt)*), $N:ident) => {
                    #[allow(missing_copy_implementations)]
                    #[allow(non_camel_case_types)]
                    #[allow(dead_code)]
                    $(#[$attr])*
                    $($vis)* struct $N {__private_field: ()}
                    #[doc(hidden)]
                    $($vis)* static $N: $N = $N {__private_field: ()};
                };
                () => ()
            }
            macro_rules!__lazy_static_internal{($($tt:tt)*)=>(crate::__cargo_equip_macro_def___lazy_static_1_4_0___lazy_static_internal!{$($tt)*})}

            #[macro_export(local_inner_macros)]
            macro_rules! /*lazy_static*/__cargo_equip_macro_def___lazy_static_1_4_0_lazy_static {
                ($(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
                    // use `()` to explicitly forward the information about private items
                    __lazy_static_internal!($(#[$attr])* () static ref $N : $T = $e; $($t)*);
                };
                ($(#[$attr:meta])* pub static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
                    __lazy_static_internal!($(#[$attr])* (pub) static ref $N : $T = $e; $($t)*);
                };
                ($(#[$attr:meta])* pub ($($vis:tt)+) static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
                    __lazy_static_internal!($(#[$attr])* (pub ($($vis)+)) static ref $N : $T = $e; $($t)*);
                };
                () => ()
            }
            macro_rules!lazy_static{($($tt:tt)*)=>(crate::__cargo_equip_macro_def___lazy_static_1_4_0_lazy_static!{$($tt)*})}

            pub trait LazyStatic {
                fn initialize(lazy: &Self);
            }

            pub fn initialize<T: LazyStatic>(lazy: &T) {
                LazyStatic::initialize(lazy);
            }
        }

        pub mod proconio {
            // Copyright 2019 statiolake <statiolake@gmail.com>
            //
            // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
            // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
            // http://opensource.org/licenses/MIT>, at your option. This file may not be copied, modified, or
            // distributed except according to those terms.

            #![allow(clippy::needless_doctest_main, clippy::print_literal)]

            pub use crate::__cargo_equip::macros::proconio::*;
            use crate::__cargo_equip::preludes::proconio::*;
            pub use proconio_derive::*;

            pub mod marker {
                // Copyright 2019 statiolake <statiolake@gmail.com>
                //
                // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
                // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
                // http://opensource.org/licenses/MIT>, at your option. This file may not be copied, modified, or
                // distributed except according to those terms.

                use crate::__cargo_equip::crates::proconio::source::{Readable, Source};
                use crate::__cargo_equip::preludes::proconio::*;
                use std::io::BufRead;

                pub enum Chars {}

                impl Readable for Chars {
                    type Output = Vec<char>;
                    fn read<R: BufRead, S: Source<R>>(source: &mut S) -> Vec<char> {
                        source.next_token_unwrap().chars().collect()
                    }
                }

                pub enum Bytes {}

                impl Readable for Bytes {
                    type Output = Vec<u8>;
                    fn read<R: BufRead, S: Source<R>>(source: &mut S) -> Vec<u8> {
                        source.next_token_unwrap().bytes().collect()
                    }
                }

                pub enum Usize1 {}

                impl Readable for Usize1 {
                    type Output = usize;
                    fn read<R: BufRead, S: Source<R>>(source: &mut S) -> usize {
                        // panic if the subtraction overflows
                        usize::read(source)
                            .checked_sub(1)
                            .expect("attempted to read the value 0 as a Usize1")
                    }
                }

                pub enum Isize1 {}

                impl Readable for Isize1 {
                    type Output = isize;
                    fn read<R: BufRead, S: Source<R>>(source: &mut S) -> isize {
                        // FIXME: Which is appropriate, forbidding all negative values or only isize::MIN. For now
                        // we disallow only isize::MIN.
                        // ensure the value is more than isize::MIN, or subtract overflows.
                        isize::read(source).checked_sub(1).unwrap_or_else(|| {
                            panic!(
                                concat!(
                                    "attempted to read the value {} as a Isize1:",
                                    " the value is isize::MIN and cannot be decremented"
                                ),
                                std::isize::MIN,
                            )
                        })
                    }
                }
            }
            pub mod source {
                // Copyright 2019 statiolake <statiolake@gmail.com>
                //
                // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
                // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
                // http://opensource.org/licenses/MIT>, at your option. This file may not be copied, modified, or
                // distributed except according to those terms.

                use crate::__cargo_equip::preludes::proconio::*;
                use std::any::type_name;
                use std::fmt::Debug;
                use std::io::BufRead;
                use std::str::FromStr;

                pub mod line {
                    // Copyright 2019 statiolake <statiolake@gmail.com>
                    //
                    // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
                    // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
                    // http://opensource.org/licenses/MIT>, at your option. This file may not be copied, modified, or
                    // distributed except according to those terms.

                    use super::Source;
                    use crate::__cargo_equip::preludes::proconio::*;
                    use std::io::BufRead;
                    use std::iter::Peekable;
                    use std::str::SplitWhitespace;

                    pub struct LineSource<R: BufRead> {
                        // FIXME: This is actually not 'static but it is treated as 'static for the
                        // same reason with crate::source::once::Source.  Also there is no way to
                        // separate context and tokens since they are private field, this is safe.
                        tokens: Peekable<SplitWhitespace<'static>>,

                        // context `tokens` reffering to
                        current_context: Box<str>,

                        reader: R,
                    }

                    impl<R: BufRead> LineSource<R> {
                        pub fn new(reader: R) -> LineSource<R> {
                            // dummy values.
                            LineSource {
                                current_context: "".to_string().into_boxed_str(),
                                tokens: "".split_whitespace().peekable(),
                                reader,
                            }
                        }

                        fn prepare(&mut self) {
                            while self.tokens.peek().is_none() {
                                let mut line = String::new();
                                let num_bytes = self
                                    .reader
                                    .read_line(&mut line)
                                    .expect("failed to get linel maybe an IO error.");

                                if num_bytes == 0 {
                                    // reached EOF
                                    return;
                                }

                                self.current_context = line.into_boxed_str();
                                self.tokens = unsafe {
                                    std::mem::transmute::<_, &'static str>(&*self.current_context)
                                }
                                .split_whitespace()
                                .peekable();
                            }
                        }
                    }

                    impl<R: BufRead> Source<R> for LineSource<R> {
                        fn next_token(&mut self) -> Option<&str> {
                            // while tokens are empty, reads a new line.
                            self.prepare();
                            self.tokens.next()
                        }

                        fn is_empty(&mut self) -> bool {
                            self.prepare();
                            self.tokens.peek().is_none()
                        }
                    }

                    use std::io::BufReader;

                    impl<'a> From<&'a str> for LineSource<BufReader<&'a [u8]>> {
                        fn from(s: &'a str) -> LineSource<BufReader<&'a [u8]>> {
                            LineSource::new(BufReader::new(s.as_bytes()))
                        }
                    }
                }
                pub mod once {
                    // Copyright 2019 statiolake <statiolake@gmail.com>
                    //
                    // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
                    // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
                    // http://opensource.org/licenses/MIT>, at your option. This file may not be copied, modified, or
                    // distributed except according to those terms.

                    use super::Source;
                    use crate::__cargo_equip::preludes::proconio::*;
                    use std::io::BufRead;
                    use std::iter::Peekable;
                    use std::marker::PhantomData;
                    use std::str::SplitWhitespace;

                    pub struct OnceSource<R: BufRead> {
                        // Of course this is not 'static actually, but it is always valid reference
                        // while entire `Source` is alive.  The actual lifetime is the context's
                        // inner lifetime, and it is essentially the lifetime of self.  Also note
                        // that there is no way to separate context and tokens since they are both
                        // private field.
                        //
                        // FIXME: find nicer way.
                        tokens: Peekable<SplitWhitespace<'static>>,

                        // context `tokens` is reffering to
                        context: Box<str>,

                        // to consume `R`.  Actually `OnceSource` is not need to have `R`, since reading is done in its
                        // constructor.  This is for the consistency with `LineSource` (To use smoothly through `AutoSource`).
                        _read: PhantomData<R>,
                    }

                    impl<R: BufRead> OnceSource<R> {
                        pub fn new(mut source: R) -> OnceSource<R> {
                            let mut context = String::new();
                            source
                                .read_to_string(&mut context)
                                .expect("failed to read from source; maybe an IO error.");

                            // Boxed str is no need to check to pin.
                            let context = context.into_boxed_str();

                            // We can create tokens first.  But doing so causes "unused variable
                            // `context`" warning (here `context` is Source::context, a member of
                            // Source`). To avoid the warning at first tokens are dummy and replace
                            // it using Source's context.
                            let mut res = OnceSource {
                                context,
                                tokens: "".split_whitespace().peekable(),
                                _read: PhantomData,
                            };

                            use std::mem;
                            let context: &'static str = unsafe { mem::transmute(&*res.context) };
                            res.tokens = context.split_whitespace().peekable();

                            res
                        }
                    }

                    impl<R: BufRead> Source<R> for OnceSource<R> {
                        fn next_token(&mut self) -> Option<&str> {
                            self.tokens.next()
                        }

                        fn is_empty(&mut self) -> bool {
                            self.tokens.peek().is_none()
                        }
                    }

                    use std::io::BufReader;

                    impl<'a> From<&'a str> for OnceSource<BufReader<&'a [u8]>> {
                        fn from(s: &'a str) -> OnceSource<BufReader<&'a [u8]>> {
                            OnceSource::new(BufReader::new(s.as_bytes()))
                        }
                    }
                }

                pub mod auto {

                    #[cfg(debug_assertions)]
                    pub use super::line::LineSource as AutoSource;
                    #[cfg(not(debug_assertions))]
                    pub use super::once::OnceSource as AutoSource;
                    use crate::__cargo_equip::preludes::proconio::*;
                }

                pub trait Source<R: BufRead> {
                    fn next_token(&mut self) -> Option<&str>;

                    fn is_empty(&mut self) -> bool;

                    fn next_token_unwrap(&mut self) -> &str {
                        self.next_token().expect(concat!(
                            "failed to get the next token; ",
                            "maybe reader reached an end of input. ",
                            "ensure that arguments for `input!` macro is correctly ",
                            "specified to match the problem input."
                        ))
                    }
                }

                // &mut S where S: Source is also source.
                impl<R: BufRead, S: Source<R>> Source<R> for &'_ mut S {
                    fn next_token(&mut self) -> Option<&str> {
                        (*self).next_token()
                    }

                    fn is_empty(&mut self) -> bool {
                        (*self).is_empty()
                    }
                }

                pub trait Readable {
                    type Output;
                    fn read<R: BufRead, S: Source<R>>(source: &mut S) -> Self::Output;
                }

                // implementations of Readable for any `FromStr` types including primitives.
                impl<T: FromStr> Readable for T
                where
                    T::Err: Debug,
                {
                    type Output = T;
                    fn read<R: BufRead, S: Source<R>>(source: &mut S) -> T {
                        let token = source.next_token_unwrap();
                        match token.parse() {
                            Ok(v) => v,
                            Err(e) => panic!(
                                concat!(
                                    "failed to parse the input `{input}` ",
                                    "to the value of type `{ty}`: {err:?}; ",
                                    "ensure that the input format is collectly specified ",
                                    "and that the input value must handle specified type.",
                                ),
                                input = token,
                                ty = type_name::<T>(),
                                err = e,
                            ),
                        }
                    }
                }
            }

            use crate::__cargo_equip::crates::proconio::source::auto::AutoSource;
            use lazy_static::lazy_static;
            use std::io;
            use std::io::{BufReader, Stdin};
            use std::sync::Mutex;

            // Prepares a short path to `Readable` to enables rust-analyzer to infer `Readable::Output`.

            pub use crate::__cargo_equip::crates::proconio::source::Readable as __Readable;

            lazy_static! {
                #[doc(hidden)]
                pub static ref STDIN_SOURCE: Mutex<AutoSource<BufReader<Stdin>>> =
                    Mutex::new(AutoSource::new(BufReader::new(io::stdin())));
            }

            #[macro_export]
            macro_rules! /*input*/__cargo_equip_macro_def_proconio_input {
                // terminator
                (@from [$source:expr] @rest) => {};

                // parse mutability
                (@from [$source:expr] @rest mut $($rest:tt)*) => {
                    $crate::__cargo_equip::crates::proconio::input! {
                        @from [$source]
                        @mut [mut]
                        @rest $($rest)*
                    }
                };
                (@from [$source:expr] @rest $($rest:tt)*) => {
                    $crate::__cargo_equip::crates::proconio::input! {
                        @from [$source]
                        @mut []
                        @rest $($rest)*
                    }
                };

                // parse variable pattern
                (@from [$source:expr] @mut [$($mut:tt)?] @rest $var:tt: $($rest:tt)*) => {
                    $crate::__cargo_equip::crates::proconio::input! {
                        @from [$source]
                        @mut [$($mut)*]
                        @var $var
                        @kind []
                        @rest $($rest)*
                    }
                };

                // parse kind (type)
                (@from [$source:expr] @mut [$($mut:tt)?] @var $var:tt @kind [$($kind:tt)*] @rest) => {
                    let $($mut)* $var = $crate::__cargo_equip::crates::proconio::read_value!(@source [$source] @kind [$($kind)*]);
                };
                (@from [$source:expr] @mut [$($mut:tt)?] @var $var:tt @kind [$($kind:tt)*] @rest, $($rest:tt)*) => {
                    $crate::__cargo_equip::crates::proconio::input!(@from [$source] @mut [$($mut)*] @var $var @kind [$($kind)*] @rest);
                    $crate::__cargo_equip::crates::proconio::input!(@from [$source] @rest $($rest)*);
                };
                (@from [$source:expr] @mut [$($mut:tt)?] @var $var:tt @kind [$($kind:tt)*] @rest $tt:tt $($rest:tt)*) => {
                    $crate::__cargo_equip::crates::proconio::input!(@from [$source] @mut [$($mut)*] @var $var @kind [$($kind)* $tt] @rest $($rest)*);
                };

                (from $source:expr, $($rest:tt)*) => {
                    #[allow(unused_variables, unused_mut)]
                    let mut s = $source;
                    $crate::__cargo_equip::crates::proconio::input! {
                        @from [&mut s]
                        @rest $($rest)*
                    }
                };
                ($($rest:tt)*) => {
                    let mut locked_stdin = $crate::__cargo_equip::crates::proconio::STDIN_SOURCE.lock().expect(concat!(
                        "failed to lock the stdin; please re-run this program.  ",
                        "If this issue repeatedly occur, this is a bug in `proconio`.  ",
                        "Please report this issue from ",
                        "<https://github.com/statiolake/proconio-rs/issues>."
                    ));
                    $crate::__cargo_equip::crates::proconio::input! {
                        @from [&mut *locked_stdin]
                        @rest $($rest)*
                    }
                    drop(locked_stdin); // release the lock
                };
            }
            macro_rules!input{($($tt:tt)*)=>(crate::__cargo_equip_macro_def_proconio_input!{$($tt)*})}

            #[macro_export]
            macro_rules! /*read_value*/__cargo_equip_macro_def_proconio_read_value {
                // array and variable length array
                (@source [$source:expr] @kind [[$($kind:tt)*]]) => {
                    $crate::__cargo_equip::crates::proconio::read_value!(@array @source [$source] @kind [] @rest $($kind)*)
                };
                (@array @source [$source:expr] @kind [$($kind:tt)*] @rest) => {{
                    let len = <usize as $crate::__cargo_equip::crates::proconio::__Readable>::read($source);
                    $crate::__cargo_equip::crates::proconio::read_value!(@source [$source] @kind [[$($kind)*; len]])
                }};
                (@array @source [$source:expr] @kind [$($kind:tt)*] @rest ; $($rest:tt)*) => {
                    $crate::__cargo_equip::crates::proconio::read_value!(@array @source [$source] @kind [$($kind)*] @len [$($rest)*])
                };
                (@array @source [$source:expr] @kind [$($kind:tt)*] @rest $tt:tt $($rest:tt)*) => {
                    $crate::__cargo_equip::crates::proconio::read_value!(@array @source [$source] @kind [$($kind)* $tt] @rest $($rest)*)
                };
                (@array @source [$source:expr] @kind [$($kind:tt)*] @len [$($len:tt)*]) => {{
                    let len = $($len)*;
                    (0..len)
                        .map(|_| $crate::__cargo_equip::crates::proconio::read_value!(@source [$source] @kind [$($kind)*]))
                        .collect::<Vec<_>>()
                }};

                // tuple
                (@source [$source:expr] @kind [($($kinds:tt)*)]) => {
                    $crate::__cargo_equip::crates::proconio::read_value!(@tuple @source [$source] @kinds [] @current [] @rest $($kinds)*)
                };
                (@tuple @source [$source:expr] @kinds [$([$($kind:tt)*])*] @current [] @rest) => {
                    (
                        $($crate::__cargo_equip::crates::proconio::read_value!(@source [$source] @kind [$($kind)*]),)*
                    )
                };
                (@tuple @source [$source:expr] @kinds [$($kinds:tt)*] @current [$($curr:tt)*] @rest) => {
                    $crate::__cargo_equip::crates::proconio::read_value!(@tuple @source [$source] @kinds [$($kinds)* [$($curr)*]] @current [] @rest)
                };
                (@tuple @source [$source:expr] @kinds [$($kinds:tt)*] @current [$($curr:tt)*] @rest, $($rest:tt)*) => {
                    $crate::__cargo_equip::crates::proconio::read_value!(@tuple @source [$source] @kinds [$($kinds)* [$($curr)*]] @current [] @rest $($rest)*)
                };
                (@tuple @source [$source:expr] @kinds [$($kinds:tt)*] @current [$($curr:tt)*] @rest $tt:tt $($rest:tt)*) => {
                    $crate::__cargo_equip::crates::proconio::read_value!(@tuple @source [$source] @kinds [$($kinds)*] @current [$($curr)* $tt] @rest $($rest)*)
                };

                // unreachable
                (@source [$source:expr] @kind []) => {
                    compile_error!(concat!("Reached unreachable statement while parsing macro input.  ", "This is a bug in `proconio`.  ", "Please report this issue from ", "<https://github.com/statiolake/proconio-rs/issues>."));
                };

                // normal other
                (@source [$source:expr] @kind [$kind:ty]) => {
                    <$kind as $crate::__cargo_equip::crates::proconio::__Readable>::read($source)
                }
            }
            macro_rules!read_value{($($tt:tt)*)=>(crate::__cargo_equip_macro_def_proconio_read_value!{$($tt)*})}

            pub fn is_stdin_empty() -> bool {
                use crate::__cargo_equip::crates::proconio::source::Source;
                let mut lock = STDIN_SOURCE.lock().expect(concat!(
                    "failed to lock the stdin; please re-run this program.  ",
                    "If this issue repeatedly occur, this is a bug in `proconio`.  ",
                    "Please report this issue from ",
                    "<https://github.com/statiolake/proconio-rs/issues>."
                ));
                lock.is_empty()
            }
        }

        pub mod __proconio_derive_0_2_1 {
            pub use crate::__cargo_equip::macros::__proconio_derive_0_2_1::*;
            #[macro_export]
            macro_rules! __cargo_equip_macro_def___proconio_derive_0_2_1_derive_readable {
                ($(_:tt)*) => {
                    ::std::compile_error!(
                        "`derive_readable` from `proconio-derive 0.2.1` should have been expanded"
                    );
                };
            }
            #[macro_export]
            macro_rules! __cargo_equip_macro_def___proconio_derive_0_2_1_fastout {
                ($(_:tt)*) => {
                    ::std::compile_error!(
                        "`fastout` from `proconio-derive 0.2.1` should have been expanded"
                    );
                };
            }
        }
    }

    pub(crate) mod macros {
        pub mod __lazy_static_1_4_0 {
            pub use crate::{
                __cargo_equip_macro_def___lazy_static_1_4_0___lazy_static_create as __lazy_static_create,
                __cargo_equip_macro_def___lazy_static_1_4_0___lazy_static_internal as __lazy_static_internal,
                __cargo_equip_macro_def___lazy_static_1_4_0_lazy_static as lazy_static,
            };
        }

        pub mod proconio {
            pub use crate::{
                __cargo_equip_macro_def_proconio_input as input,
                __cargo_equip_macro_def_proconio_read_value as read_value,
            };
        }

        pub mod __proconio_derive_0_2_1 {
            pub use crate::{
                __cargo_equip_macro_def___proconio_derive_0_2_1_derive_readable as derive_readable,
                __cargo_equip_macro_def___proconio_derive_0_2_1_fastout as fastout,
            };
        }
    }

    pub(crate) mod prelude {
        pub use crate::__cargo_equip::{crates::*, macros::__lazy_static_1_4_0::*};
    }

    mod preludes {
        pub mod __lazy_static_1_4_0 {
            pub(in crate::__cargo_equip) use crate::__cargo_equip::macros::__lazy_static_1_4_0::*;
        }

        pub mod proconio {
            pub(in crate::__cargo_equip) use crate::__cargo_equip::crates::{
                __lazy_static_1_4_0 as lazy_static, __proconio_derive_0_2_1 as proconio_derive,
            };
            pub(in crate::__cargo_equip) use crate::__cargo_equip::macros::__lazy_static_1_4_0::*;
        }

        pub mod __proconio_derive_0_2_1 {}
    }
}


#![allow(unused_imports)]
use std::io::{ self, Write };
use std::str::FromStr;
use std::cmp::{ min, max };
use std::collections::{ BinaryHeap, VecDeque };

macro_rules! trace {
    ($var:expr) => ({
        let _ = writeln!(&mut std::io::stderr(), ">>> {} = {:?}", stringify!($var), $var);
    })
}
macro_rules! swap { ($a:expr, $b:expr) => ({ let t = $b; $b = $a; $a = t; }) }

fn main() {
    let mut sc = Scanner::new();
    let a: i32 = sc.cin();
    let b: i32 = sc.cin();

    let k = if a == b + 1 || (a == b && a > 0) || a + 1 == b { "YES" } else { "NO" };
    println!("{}", k);

}

#[allow(dead_code)]
struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
#[allow(dead_code)]
impl Scanner {
    fn new() -> Scanner { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn reserve(&mut self) {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
    }
    fn cin<T: FromStr>(&mut self) -> T {
        self.reserve();
        match self.buffer.pop_front().unwrap().parse::<T>() {
            Ok(a) => a,
            Err(_) => panic!("parse err")
        }
    }
    fn get_char(&mut self) -> char {
        self.reserve();
        let head = self.buffer[0].chars().nth(0).unwrap();
        let tail = String::from( &self.buffer[0][1..] );
        if tail.len()>0 { self.buffer[0]=tail } else { self.buffer.pop_front(); }
        head
    }
}


use std::io::stdin;
use std::io::prelude::*;
use std::iter::*;
use std::str::SplitWhitespace;
use std::cmp::min;

fn main() {
    let mut input = InRead::new();
    let n = input.int();
    let a = input.int();
    let b = input.int();
    let c = input.int();
    let x = min(a, b);
    let res = if n == 1 { 0 } else { x + min(x, c) * (n - 2) };
    println!("{}", res);
}

struct InRead(String);

impl InRead {
    fn new() -> InRead {
        InRead(String::new())
    }
    fn get_line(self: &mut Self) {
        self.0.clear();
        stdin().read_line(&mut self.0);
    }
    fn parse_int(s: &str) -> i32 { s.parse().unwrap() }
    fn ints(self: &mut Self) -> Map<SplitWhitespace, fn(&str) -> i32> {
        self.get_line();
        self.0.split_whitespace().map(InRead::parse_int)
    }
    fn int_vec(self: &mut Self) -> Vec<i32> { self.ints().collect() }
    fn int(self: &mut Self) -> i32 { self.ints().next().unwrap() }
}


use std::io;

fn main() {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).expect("failed to read input");
    io::stdin().read_line(&mut buffer).expect("failed to read input");
    io::stdin().read_line(&mut buffer).expect("failed to read input");
    let mut buffer_iter = buffer.split_whitespace().map(|n| n.parse::<u32>().unwrap());
    let b = buffer_iter.next().unwrap();
    let g = buffer_iter.next().unwrap();
    let n = buffer_iter.next().unwrap();

    let (x1, x2) = if b >= g {
        (b, g)
    } else {
        (g, b)
    };

    let result = if x2 < n {
        x2 + 1 - if n > x1 { n - x1 } else { 0 }
    } else {
        n + 1
    };
    println!("{}", result);
}


use std::io;

fn main() {
	let mut input = String::new();
	io::stdin().read_line(&mut input)
		.expect("Time to panic");
	let mut remaining:u64 = input.trim().parse().unwrap();
	let mut notes:u64 = 0;
	//100 notes
	notes += remaining/100;
	remaining = remaining%100;
	//20 notes
	notes += remaining/20;
	remaining = remaining%20;
	//10 notes
	notes += remaining/10;
	remaining = remaining%10;
	//5 notes
	notes += remaining/5;
	remaining = remaining%5;
	//100 notes
	notes += remaining;

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


#[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 main() {
    let n = get!(u64);

    let ans = (1..)
        .map(|k| (2u64.pow(k as u32) - 1) * (2u64.pow(k as u32 - 1)))
        .take_while(|&x| x <= n)
        .filter(|&x| n % x == 0)
        .last()
        .unwrap();

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


use std::io::*;

fn reads<T: std::str::FromStr>(i: &mut StdinLock) -> Vec<T> {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn operate(n: i64, k: i64) -> (bool, i64) {
    // 0 1 2 3 4 5 6 7
    // 1
    // 1 2
    // 1 3 2
    // 1 3 2 4
    // 1 3 5 2 4
    // 1 3 5 2 4 6
    // 1 3 5 7 2 4 6
    // 1 3 5 7 2 4 6 8

    if n == 1 {
        return (false, 1);
    }

    let nf = n as f64;

    let start_of_even = (nf / 2.).ceil() as i64 + 1;

    let offset = if start_of_even <= k {
        k - start_of_even + 1
    } else {
        k
    };

    (start_of_even <= k, offset as i64)
}

fn main() {
    // initialize stdin
    let sin = std::io::stdin();
    let mut sin = sin.lock();
    let sin = &mut sin;

    let inputs: Vec<i64> = reads(sin);
    let n = inputs[0];
    let k = inputs[1];

    let (is_even, idx) = operate(n, k);

    let ans = if is_even { 2 * idx } else { 2 * idx - 1 };

    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_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 mut n = input.i();
    loop {
        let mut x = n;
        let mut sum = 0;
        while x > 0 {
            sum += x % 10;
            x /= 10;
        }
        if sum % 4 == 0 {
            println!("{}", n);
            break;
        }
        n += 1;
    }
}


use std::io::BufRead;

const MOD: i64 = 1_000_000_007;

fn power(a: i64, p: i64) -> i64 {
    if p == 0 {
        return 1;
    }
    let mut res = power(a, p / 2);
    res = (res * res) % MOD;
    if p % 2 != 0 {
        res = (res * a) % MOD;
    }
    res
}

fn solve(n: i64, m: i64) -> i64 {
    power((power(2, m) + MOD - 1) % MOD, n)
}

fn main() {
    let stdin = std::io::stdin();
    let mut handle = stdin.lock();
    let mut buf = String::new();
    handle.read_line(&mut buf).unwrap();
    let mut it = buf.split_whitespace();
    let (n, m): (i64, i64) = (
        it.next().unwrap().parse().unwrap(),
        it.next().unwrap().parse().unwrap(),
    );
    println!("{}", solve(n, m));
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_power() {
        assert_eq!(power(0, 0), 1);
        assert_eq!(power(2, 1), 2);
        assert_eq!(power(2, 2), 4);
        assert_eq!(power(2, 3), 8);
    }

    #[test]
    fn test_solve() {
        assert_eq!(solve(1, 3), 7);
        assert_eq!(solve(2, 2), 9);
        assert_eq!(solve(1_000_000_000, 1_000_000_000), 751201557);
    }
}


#[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 a =readvec!(i32);
  a.sort();
  let mut i1 = 10;
  let mut i2 = 10;
  if a[0] == a[3] {
    i1 = 4;
    i2 = 5;
  } else if a[1] == a[4] {
    i1 = 0;
    i2 = 5;
  } else if a[2] == a[5] {
    i1 = 0;
    i2 = 1;
  } else {
    println!("Alien");
    return;
  }
  if i1 >= a.len() {
    println!("Alien");
    return;
  }
  if a[i1] == a[i2] {
    println!("Elephant");
  } else {
    println!("Bear");
  }
}


fn main() {
    let mut input = String::new();
    std::io::stdin().read_line(&mut input).expect("input: read line failed");
    let vec = input.trim().split_whitespace().map(|item| {
        item.parse::<usize>().expect("item: parse to usize failed")
    }).collect::<Vec<usize>>();

    let (a_amount, b_amount, ab_amount) = (vec[0], vec[1], vec[2]);

    let length = 2 * ab_amount
        +  2 * min(a_amount, b_amount)
        + if max(a_amount, b_amount) - min(a_amount, b_amount) > 0 { 1 } else { 0 };
    println!("{}", length);

}

fn min(one: usize, another: usize) -> usize {
    if one < another { one } else { another }
}

fn max(one: usize, another: usize) -> usize {
    if one > another { one } else { another }
}


fn run() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let y: u32 = s.trim().parse().unwrap();
    let leap = |x: u32| -> bool {
        x % 400 == 0 || (x % 4 == 0 && x % 100 != 0)
    };
    let mut p = 1 + leap(y) as usize;
    let mut q = y + 1;
    while p != 0 || leap(q) != leap(y) {
        p = (p + 1) % 7;
        if leap(q) {
            p = (p + 1) % 7;
        }
        q += 1;
    }
    println!("{}", q);
}

fn main() {
    run();
}


fn main() {
    let mut input = String::new();
    std::io::stdin().read_line(&mut input).expect("input: read line failed");

    let vec = input.trim().split_whitespace().map(|item| {
        item.parse::<i32>().unwrap()
    }).collect::<Vec<i32>>();

    if vec[0] > vec[1] + vec[2] {
        println!("+");
    } else if vec[0] + vec[2] < vec[1] {
        println!("-");
    } else if vec[0] == vec[1] && vec[2] == 0 {
        println!("0");
    } else {
        println!("?");
    }
}


use std::io;
fn main(){
    let mut s:String=String::new();
    io::stdin().read_line(&mut s).unwrap();
    let n:i64=s.trim().parse::<i64>().unwrap();
    let mut b:i64=0;
    let mut p:i64=0;
    let mut m:i64=0;
    for c in 0..n{
        s.clear();
        io::stdin().read_line(&mut s).unwrap();
        b=s.trim().parse::<i64>().unwrap();
        if b%7==0 || b%3==0{println!("YES")}
        else{
            p=b/7;
            m=p*7;
            while p!=0 && m!=b{
                m+=3;
                if m>b{p-=1;m=p*7}
            }
            if p==0{println!("NO")}
            else{println!("YES")}
        }
    }
}


use std::io;

fn get_count(n: u32) -> u32 {
    let mut count = 0;

    for i in 1..n {
        if n % i == 0 {
            count += 1;
        }
    }

    count
}

pub fn solution() -> io::Result<()> {
    let mut number = String::new();

    io::stdin().read_line(&mut number)?;
    let number = number.trim().parse::<u32>().unwrap();

    println!("{}", get_count(number));
    Ok(())
}

fn main() {
    solution();
}


use std::io::{self, BufWriter, Read, Write};

fn main() {
    let mut stdin = io::stdin();
    // From https://keens.github.io/blog/2017/10/05/rustdekousokunahyoujunshutsuryoku/
    let stdout = io::stdout();
    let mut output = BufWriter::new(stdout.lock());
    let mut input_str = String::new();
    let _ = stdin.read_to_string(&mut input_str);
    let mut input_iter = input_str.split_ascii_whitespace();
    // From https://github.com/rust-lang-ja/atcoder-rust-resources/wiki/2020-Update#proconio
    sub_main(&mut input_iter, &mut output);
}

fn sub_main(input_iter: &mut dyn Iterator<Item = &str>, output: &mut dyn Write) {
    macro_rules! read(() => (input_iter.next().unwrap().parse().unwrap()));
    macro_rules! print(( $( $x:expr ),*) => (write!(output, $($x,)*).unwrap()));
    macro_rules! println(( $( $x:expr ),*) => (writeln!(output, $($x,)*).unwrap()));
    // Deal with each case
    let n: usize = read!();
    let non_cyclic = ModP(2).pow(n - 1);
    let mut total_num = ModP(1);
    for i in 1..=n {
        total_num = total_num * ModP(i as u64);
    }
    let ans = total_num - non_cyclic;
    println!("{}", ans.0);
}

use std::ops::{Add, Div, Mul, Sub};

const MODULUS: u64 = 1000000007;

#[derive(Clone, Copy, PartialEq, Debug)]
struct ModP(u64);

impl Add for ModP {
    type Output = Self;
    fn add(self, rhs: Self) -> Self {
        return ModP((self.0 + rhs.0) % MODULUS);
    }
}
impl Sub for ModP {
    type Output = Self;
    fn sub(self, rhs: Self) -> Self {
        return ModP((self.0 + MODULUS - rhs.0) % MODULUS);
    }
}
impl Mul for ModP {
    type Output = Self;
    fn mul(self, rhs: Self) -> Self {
        return ModP((self.0 * rhs.0) % MODULUS);
    }
}
impl Div for ModP {
    type Output = Self;
    fn div(self, rhs: Self) -> Self {
        if rhs.0 == 0 {
            panic!("Tried to divide by ModP(0)!");
        }
        let rhs_inv = rhs.pow((MODULUS - 2) as usize);
        return self * rhs_inv;
    }
}

impl ModP {
    fn pow(&self, n: usize) -> Self {
        if n == 0 {
            return ModP(1);
        } else if n == 1 {
            return *self;
        } else {
            let half = self.pow(n / 2);
            if n % 2 == 0 {
                return half * half;
            } else {
                return half * half * (*self);
            }
        }
    }
}


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

fn read_std() -> Vec<i32> {
    let mut buffer = String::new();
    let _ = io::stdin().read_line(&mut buffer);
    let buffvec: Vec<&str> = buffer.trim().split(" ").collect();
    let mut numvec: Vec<i32> = vec![];
    for x in &buffvec {
        let buff: i32 = FromStr::from_str(x).unwrap();
        numvec.push(buff);
    }
    numvec
}

fn vec_to_str(smvec: Vec<i32>) -> Vec<String> {
    let mut newvec: Vec<String> = vec![];
    for x in smvec {
        newvec.push(format!("{}", x));
    }
    newvec
}

fn main() {
    let nums = read_std();
    let n = nums[0];
    let k = nums[1];

    let mut delvec: Vec<i32> = vec![2];

    for y in 2..n+1 {
        let mut state = true;
        'inner: for x in &delvec {
            if y % x == 0 {
                state = false;
                break 'inner;
            }
        }
        if state {
            delvec.push(y);
        }
    }
    // println!("{:?}", delvec);
    let mut anvec: Vec<i32> = vec![];
    let mut last = n;
    while last > 1 {
        for x in &delvec {
            if last % x == 0 {
                anvec.push(*x);
                last /= *x;
            }
        }
    }

    if anvec.len() < k as usize {
        println!("-1");
    } else {
        while anvec.len() > k as usize {
            anvec[0] *= anvec.pop().unwrap()
        }
        println!("{}", vec_to_str(anvec).join(" "));
    }

}


#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::Read;
#[allow(dead_code)]
fn getline() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok().unwrap();
    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 = String::from_utf8(buf).unwrap();
            return ret;
        }
    }
}

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

/// min{x | x * (x + 1) / 2 >= v }
fn calc(v: i64) -> i64 {
    assert! (v > 0);
    let piv = (2. * v as f64).sqrt() as i64;
    for k in max(piv - 10, 0) .. piv + 10 {
        if k * (k + 1) >= 2 * v {
            return k;
        }
    }
    panic!();
}

fn solve() {
    let n: i64 = get();
    let m: i64 = get();
    if n <= m {
        println!("{}", n);
        return;
    }
    println!("{}", m + calc(n - m));
}

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();
}