#![allow(dead_code, unused_macros, unused_imports)]
use std::{cell::{Cell, RefCell, UnsafeCell}, cmp::{Ordering, Reverse, max, min}, collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque, hash_map::{DefaultHasher, RandomState}}, error::Error, fmt::{Display, Write as FmtWrite}, hash::{BuildHasher, Hash, Hasher}, io::{BufWriter, Read, Stdin, Stdout, Write}, iter::{FromIterator, Peekable}, mem::swap, ops::*, process::exit, rc::Rc, str::{FromStr, from_utf8_unchecked}, time::{Duration, Instant}, convert::{TryInto, TryFrom}, marker::PhantomData};

const IO_BUF_SIZE: usize = 1 << 16;
type Input = Scanner<Stdin>;
type Output = BufWriter<Stdout>;
fn _init_input() -> Input { Scanner::new(std::io::stdin()) }
fn _init_output() -> Output { BufWriter::with_capacity(IO_BUF_SIZE, std::io::stdout()) }

#[repr(transparent)] struct Unsync<T>(T);
unsafe impl<T> Sync for Unsync<T> {}

type BadLazy<T> = Unsync<UnsafeCell<Option<T>>>;
impl<T> BadLazy<T> {
    const fn new() -> Self { Self(UnsafeCell::new(None)) }
}

static INPUT: BadLazy<Input> = BadLazy::new();
static OUTPUT: BadLazy<Output> = BadLazy::new();

fn inp<F: FnOnce(&mut Input) -> R, R>(f: F) -> R {
    unsafe { f((&mut *INPUT.0.get()).get_or_insert_with(_init_input)) }
}
fn out<F: FnOnce(&mut Output) -> R, R>(f: F) -> R {
    unsafe { f((&mut *OUTPUT.0.get()).get_or_insert_with(_init_output)) }
}

macro_rules! read {
    () => { read() };
    ($t: ty) => { read::<$t>() };
    ($t: ty, $($tt: ty),*) => { (read::<$t>(), $(read::<$tt>(),)*) };
    [$t: ty; $n: expr] => { read_vec::<$t>($n) };
}
macro_rules! println {
    () => { out(|x| { let _ = writeln!(x); }) };
    ($exp: expr) => { out(|x| { let _ = writeln!(x, "{}", $exp); }) };
    ($fmt: expr, $($arg : tt )*) => { out(|x| { let _ = writeln!(x, $fmt, $($arg)*); }) }
}
macro_rules! print {
    ($exp: expr) => { out(|x| { let _ = write!(x, "{}", $exp); }) };
    ($fmt: expr, $($arg : tt )*) => { out(|x| { let _ = write!(x, $fmt, $($arg)*); }) }
}

fn out_flush() { out(|x| { let _ = x.flush(); }); }

fn input_is_eof() -> bool { inp(|x| x.eof()) }
fn read_byte() -> u8 { inp(|x| x.byte()) }
fn read_bytes_no_skip(n: usize) -> Vec<u8> { inp(|x| x.bytes_no_skip(n)) }
fn read_bytes(n: usize) -> Vec<u8> { inp(|x| x.bytes(n)) }
fn read_bytes2(n: usize, m: usize) -> Vec<Vec<u8>> { inp(|x| x.bytes2(n, m)) }
fn read_token() -> Vec<u8> { inp(|x| x.token_bytes()) }
fn read_token_str() -> String { unsafe { String::from_utf8_unchecked(read_token()) } }
fn read_line() -> Vec<u8> { inp(|x| x.line_bytes()) }
fn read_line_str() -> String { unsafe { String::from_utf8_unchecked(read_line()) } }
fn read<T: FromStr>() -> T { read_token_str().parse::<T>().ok().expect("failed parse") }
fn read_vec<T: FromStr>(n: usize) -> Vec<T> { (0..n).map(|_| read()).collect() }
fn read_vec2<T: FromStr>(n: usize, m: usize) -> Vec<Vec<T>> { (0..n).map(|_| read_vec(m)).collect() }

struct Scanner<R: Read> {
    src: R,
    _buf: Vec<u8>,
    _pt: usize, // pointer
    _rd: usize, // bytes read
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(src: R) -> Scanner<R> {
        Scanner { src, _buf: vec![0; IO_BUF_SIZE], _pt: 1, _rd: 1 }
    }

    fn _check_buf(&mut self) {
        if self._pt == self._rd {
            self._rd = self.src.read(&mut self._buf).unwrap_or(0);
            self._pt = (self._rd == 0) as usize;
        }
    }

    // returns true if end of file
    fn eof(&mut self) -> bool {
        self._check_buf();
        self._rd == 0
    }

    // filters \r, returns \0 if eof
    fn byte(&mut self) -> u8 {
        loop {
            self._check_buf();
            if self._rd == 0 { return 0; }
            let res = self._buf[self._pt];
            self._pt += 1;
            if res != b'\r' { return res; }
        }
    }

    fn bytes_no_skip(&mut self, n: usize) -> Vec<u8> { (0..n).map(|_| self.byte()).collect() }
    fn bytes(&mut self, n: usize) -> Vec<u8> {
        let res = self.bytes_no_skip(n);
        self.byte();
        res
    }
    fn bytes2(&mut self, n: usize, m: usize) -> Vec<Vec<u8>> { (0..n).map(|_| self.bytes(m)).collect() }

    fn token_bytes(&mut self) -> Vec<u8> {
        let mut res = Vec::new();
        let mut c = self.byte();
        while c <= b' ' {
            if c == b'\0' { return res; }
            c = self.byte();
        }
        loop {
            res.push(c);
            c = self.byte();
            if c <= b' ' { return res; }
        }
    }

    fn line_bytes(&mut self) -> Vec<u8> {
        let mut res = Vec::new();
        let mut c = self.byte();
        while c != b'\n' && c != b'\0' {
            res.push(c);
            c = self.byte();
        }
        res
    }
}

trait JoinToStr {
    fn join_to_str(self, sep: &str) -> String;
    fn concat_to_str(self) -> String;
}
impl<T: Display, I: Iterator<Item = T>> JoinToStr for I {
    fn join_to_str(mut self, sep: &str) -> String {
        match self.next() {
            Some(first) => {
                let mut res = first.to_string();
                while let Some(item) = self.next() {
                    res.push_str(sep);
                    res.push_str(&item.to_string());
                }
                res
            }
            None => { String::new() }
        }
    }

    fn concat_to_str(self) -> String {
        let mut res = String::new();
        for item in self { res.push_str(&item.to_string()); }
        res
    }
}
trait AsStr { fn as_str(&self) -> &str; }
impl AsStr for [u8] { fn as_str(&self) -> &str {std::str::from_utf8(self).expect("attempt to convert non-UTF8 byte string.")} }

macro_rules! veci {
    ($n:expr , $i:ident : $gen:expr) => {{
        let _veci_n = $n;
        let mut _veci_list = Vec::with_capacity(_veci_n);
        for $i in 0.._veci_n {
            _veci_list.push($gen);
        }
        _veci_list
    }};
    ($n:expr , $gen:expr) => { veci!($n, _veci_: $gen) }
}

fn abs_diff<T: Sub<Output = T> + PartialOrd>(x: T, y: T) -> T {
    if x < y { y - x } else { x - y }
}

trait CommonNumExt {
    fn div_ceil(self, b: Self) -> Self;
    fn div_floor(self, b: Self) -> Self;
    fn gcd(self, b: Self) -> Self;
    fn highest_one(self) -> Self;
    fn lowest_one(self) -> Self;
    fn sig_bits(self) -> u32;
}

macro_rules! impl_common_num_ext {
    ($($ix:tt = $ux:tt),*) => {
        $(
            impl CommonNumExt for $ux {
                fn div_ceil(self, b: Self) -> Self {
                    let q = self / b; let r = self % b;
                    if r != 0 { q + 1 } else { q }
                }
                fn div_floor(self, b: Self) -> Self { self / b }
                fn gcd(self, mut b: Self) -> Self {
                    let mut a = self;
                    if a == 0 || b == 0 { return a | b; }
                    let shift = (a | b).trailing_zeros();
                    a >>= a.trailing_zeros();
                    b >>= b.trailing_zeros();
                    while a != b {
                        if a > b { a -= b; a >>= a.trailing_zeros(); }
                        else { b -= a; b >>= b.trailing_zeros(); }
                    }
                    a << shift
                }
                #[inline] fn highest_one(self) -> Self {
                    if self == 0 { 0 } else { const ONE: $ux = 1; ONE << self.sig_bits() - 1 }
                }
                #[inline] fn lowest_one(self) -> Self { self & self.wrapping_neg() }
                #[inline] fn sig_bits(self) -> u32 { std::mem::size_of::<$ux>() as u32 * 8 - self.leading_zeros() }
            }

            impl CommonNumExt for $ix {
                fn div_ceil(self, b: Self) -> Self {
                    let q = self / b; let r = self % b;
                    if self ^ b >= 0 && r != 0 { q + 1 } else { q }
                }
                fn div_floor(self, b: Self) -> Self {
                    let q = self / b; let r = self % b;
                    if self ^ b < 0 && r != 0 { q - 1 } else { q }
                }
                fn gcd(self, b: Self) -> Self {
                    fn w_abs(x: $ix) -> $ux { (if x.is_negative() { x.wrapping_neg() } else { x }) as _ }
                    w_abs(self).gcd(w_abs(b)) as _
                }
                #[inline] fn highest_one(self) -> Self { (self as $ux).highest_one() as _ }
                #[inline] fn lowest_one(self) -> Self { self & self.wrapping_neg() }
                #[inline] fn sig_bits(self) -> u32 { std::mem::size_of::<$ix>() as u32 * 8 - self.leading_zeros() }
            }
        )*
    }
}
impl_common_num_ext!(i8 = u8, i16 = u16, i32 = u32, i64 = u64, i128 = u128, isize = usize);

trait ChMaxMin<T> {
    fn chmax(&mut self, v: T) -> bool;
    fn chmin(&mut self, v: T) -> bool;
}
impl<T: PartialOrd> ChMaxMin<T> for Option<T> {
    fn chmax(&mut self, v: T) -> bool { if self.is_none() || v > *self.as_ref().unwrap() { *self = Some(v); true } else { false } }
    fn chmin(&mut self, v: T) -> bool { if self.is_none() || v < *self.as_ref().unwrap() { *self = Some(v); true } else { false } }
}
impl<T: PartialOrd> ChMaxMin<T> for T {
    fn chmax(&mut self, v: T) -> bool { if v > *self { *self = v; true } else { false } }
    fn chmin(&mut self, v: T) -> bool { if v < *self { *self = v; true } else { false } }
}

// * end commons * //

#[allow(non_snake_case, non_upper_case_globals)]
fn main() {
    let num_cases: usize = 1;//read();

    for _case_num in 1..=num_cases {
        let p1 = read!(usize);
		let t1 = read!(i64);
		let p2 = read!(usize);
		let t2 = read!(i64);
		let h = read!(usize);
		let s = read!(usize);

		let x1 = p1 - s;
		let x2 = p2 - s;
		let x3 = p1 + p2 - s;

		let inf = i64::MAX;
		let mut ans = inf;
		let mut dp = vec![inf; h+1];
		dp[0] = 0;

		for i in 0..h { if dp[i] != inf {
			let t = dp[i];

			let mut k1 = 0;
			let mut k2 = 0;
			let mut dm = 0;
			loop {
				dp[min(h, i+dm+x3)].chmin(t + max((k1+1) * t1, (k2+1) * t2));

				if (k1 + 1) * t1 < (k2 + 1) * t2 {
					k1 += 1;
					dm += x1;
				} else {
					k2 += 1;
					dm += x2;
				}

				if i + dm >= h {
					ans.chmin(t + max(k1 * t1, k2 * t2));
					break;
				}
			}
		}}

		//println!("{:?}", &dp);

		ans.chmin(dp[h]);
		println!(ans);
    }

    out_flush();
}


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 n: usize = scan.next();
    // case 1: 1
    //      2: 1 + 1*4 = 5
    //      3: 5 + 2*4 = 13
    //      4: 13 + 3*4
    //      ....
    let mut result = 1usize;
    for i in 1..n {
        result += 4 * i;
    }
    println!("{}", result);
}

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


#[derive(Debug)]
struct RhombusIterator{
    current: isize,
    count: isize,
    total: isize,
}

impl RhombusIterator{
    pub fn new() ->Self{
        RhombusIterator{
            current: 1,
            count: 0,
            total: 1,
        }
    }
}

impl Iterator for RhombusIterator{
    type Item = isize;

    fn next(&mut self) -> Option<Self::Item> {
        match self.current{
            1 => {},
            _ => {
                self.total += 2* self.current + (2* self.count);
                self.count += 1;
            },
        }
        self.current +=1;
        Some(self.total)
    }
}

fn main() -> Result<(), Box<dyn std::error::Error>> {

    //parse
    let mut input = String::new();
    std::io::stdin().read_line(&mut input)?;
    let input: usize = input.trim().parse().expect("Invalid input parameter");

    //solve
    let result = solve(input);

    //print
    println!("{}", result);

    Ok(())
}

fn solve(input: usize) -> isize{
    let iter = RhombusIterator::new();
    iter.skip(input-1).next().expect("Could not calc rhombus")
}

#[cfg(test)]
mod test{
    use super::solve;

    #[test]
    fn test1() {

        assert_eq!(1, solve(1));
        assert_eq!(5, solve(2));
        assert_eq!(solve(3), 13);
        assert_eq!(25, solve(4));
        assert_eq!(41, solve(5));
    }
}


use std::io;

fn main() {
    let mut a_str = String::new();
    io::stdin().read_line(&mut a_str).expect("");
    let mut num = a_str.split_whitespace()
        .map(|x| x.parse::<i32>().expect("parse error"))
        .collect::<Vec<i32>>();
    let mut b_str = String::new();
    io::stdin().read_line(&mut b_str).expect("");
    let mut v = b_str.split_whitespace()
        .map(|x| x.parse::<i32>().expect("parse error"))
        .collect::<Vec<i32>>();

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

    let mut res = 0;
    v.sort();
    v.reverse();
    for i in &v {
        if k % i == 0 {
            res = k / i;
            break;
        }
    }
    println!("{}", res);

}


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

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 get<T: FromStr>() -> T
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    }

    #[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(dead_code)]
    pub fn get2<T: FromStr, U: FromStr>() -> (T, U)
    where
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }

    #[allow(dead_code)]
    pub fn get3<S: FromStr, T: FromStr, U: FromStr>() -> (S, T, U)
    where
        <S as FromStr>::Err: Debug,
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }
}

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

fn main() {
    let n: usize = util::get();
    let a: usize = util::get();
    let b: usize = util::get();
    let c: usize = util::get();

    let mut dp = vec![vec![100000; 3]; n];
    dp[0][0] = 0;

    for i in 1..n {
        dp[i][0] = min(dp[i][0], dp[i - 1][1] + a);
        dp[i][0] = min(dp[i][0], dp[i - 1][2] + b);

        dp[i][1] = min(dp[i][1], dp[i - 1][0] + a);
        dp[i][1] = min(dp[i][1], dp[i - 1][2] + c);

        dp[i][2] = min(dp[i][2], dp[i - 1][0] + b);
        dp[i][2] = min(dp[i][2], dp[i - 1][1] + c);
    }

    println!("{}", dp[n - 1].iter().min().unwrap());

}


fn main() {
    let mut input = String::new();
    use std::io::{self, prelude::*};
    io::stdin().read_to_string(&mut input).unwrap();

    let n: u64 = input.trim().parse().unwrap();

    let check = |k| {
        let mut n = n;

        let mut v = 0;
        let mut p = 0;
        loop {
            if n < k {
                v += n;
                break;
            }
            n -= k;
            v += k;

            let q = n / 10;
            n -= q;
            p += q;
        }

        p <= v
    };

    let mut low = 0;
    let mut up = (n + 1) / 2;

    while low + 1 != up {
        let cur = (low + up) / 2;
        if check(cur) {
            up = cur;
        } else {
            low = cur;
        }
    }

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


// 991C
use std::io;
fn main() {
    let n: u64 = read_one(&io::stdin());
    let mut min = 0;
    let mut max = n;
    loop {
        let mid = (min + max) / 2;
        if mid == min {
            break;
        }
        if eats_half(n, mid) {
            max = mid;
        } else {
            min = mid;
        }
    }
    println!("{}", max);
}

fn eats_half(mut n: u64, k: u64) -> bool {
    let original_n = n;
    let mut v = 0;
    while n >= k {
        n -= k;
        v += k;
        n -= n / 10;
    }
    v += n;
    return 2 * v >= original_n;
}

fn read_one<T>(stdin: &io::Stdin) -> T
where
    T: std::str::FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    let mut s = String::new();
    stdin.read_line(&mut s).unwrap();
    s.trim().split_whitespace().next().unwrap().parse().unwrap()
}


use std::cmp::min;

fn get_max_days(a: u32, b: u32, c: u32) -> u32 {
    let full_week_num: u32 = min(a / 3, min(b / 2, c / 2));
    let a_rest: u32 = a - 3 * full_week_num;
    let b_rest: u32 = b - 2 * full_week_num;
    let c_rest: u32 = c - 2 * full_week_num;

    let mut extra_days_max: u32 = 0;
    for start_weekday in 0..7 {
        let mut weekday: u32 = start_weekday;
        let mut extra_days: u32 = 0;
        let mut a_rest1: u32 = a_rest;
        let mut b_rest1: u32 = b_rest;
        let mut c_rest1: u32 = c_rest;
        loop {
            if (weekday == 0) || (weekday == 3) || (weekday == 6) {
                if a_rest1 > 0 {
                    a_rest1 -= 1;
                } else {
                    break;
                }
            } else if (weekday == 1) || (weekday == 5) {
                if b_rest1 > 0 {
                    b_rest1 -= 1;
                } else {
                    break;
                }
            } else {
                if c_rest1 > 0 {
                    c_rest1 -= 1;
                } else {
                    break;
                }
            }

            extra_days += 1;
            weekday += 1;
            weekday %= 7;
        }

        if extra_days > extra_days_max {
            extra_days_max = extra_days;
        }
    }

    return 7 * full_week_num + extra_days_max;
}

#[cfg(test)]
mod tests {
    use super::get_max_days;

    #[test]
    fn test1() {
        assert_eq!(get_max_days(2, 1, 1), 4);
    }
    #[test]
    fn test2() {
        assert_eq!(get_max_days(3, 2, 2), 7);
    }
    #[test]
    fn test3() {
        assert_eq!(get_max_days(1, 100, 1), 3);
    }
    #[test]
    fn test4() {
        assert_eq!(get_max_days(30, 20, 10), 39);
    }
}

fn read_data() -> (u32, u32, u32) {
    let mut data_str: String = String::new();
    std::io::stdin().read_line(&mut data_str).unwrap();

    let data_values: Vec<u32> = data_str
        .trim()
        .split(" ")
        .map(|s| s.parse::<u32>().unwrap())
        .collect();

    return (data_values[0], data_values[1], data_values[2]);
}

fn main() {
    let (a, b, c): (u32, u32, u32) = read_data();

    let max_days: u32 = get_max_days(a, b, c);

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


use std::io;

fn raw_input() -> String {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().to_string()
}

fn input_split() -> Vec<u16> {
    raw_input()
        .split_whitespace()
        .map(|elem| elem.parse().unwrap())
        .collect()
}

fn input() -> u16 {
    raw_input().parse().unwrap()
}

fn main() {
    let mut n = input();
    let days = input_split();

    let week_total: u16 = days.iter().sum();
    while n > week_total {
        n -= week_total;
    }

    let mut current_day = 0;
    loop {
        if days[current_day] >= n {
            break;
        } else {
            n -= days[current_day];
        }
        current_day += 1;
    }

    print!("{}", current_day + 1);
}


#![allow(unused_imports, unused_macros)]

use kyoproio::*;
use std::{
    collections::*,
    io::{self, prelude::*},
    iter,
    mem::{replace, swap},
};

fn main() -> io::Result<()> {
    std::thread::Builder::new()
        .stack_size(64 * 1024 * 1024)
        .spawn(solve)?
        .join()
        .unwrap();
    Ok(())
}

fn solve() {
    let stdin = io::stdin();
    let mut kin = KInput::new(stdin.lock());
    let stdout = io::stdout();
    let mut out = io::BufWriter::new(stdout.lock());
    macro_rules! output { ($($args:expr),+) => { write!(&mut out, $($args),+).unwrap(); }; }
    macro_rules! outputln {
        ($($args:expr),+) => { output!($($args),+); outputln!(); };
        () => { output!("\n"); if cfg!(debug_assertions) { out.flush().unwrap(); } }
    }

    const MOD: i64 = 998244353;
    let (n, k): (i64, i64) = kin.input();
    if k > n {
        outputln!("0");
        return;
    }
    let c = Combination::new(n as usize + 1, MOD);
    let mut ans = 0;
    for i in 1..=n {
        ans += c.comb(n / i - 1, k - 1);
    }
    ans %= MOD;
    outputln!("{}", ans);
}

pub fn mod_pow(mut a: i64, mut b: i64, m: i64) -> i64 {
    let mut y = 1;
    while b > 0 {
        if b & 1 == 1 {
            y = y * a % m;
        }
        a = a * a % m;
        b >>= 1;
    }
    y
}
pub fn mod_inv(x: i64, m: i64) -> i64 {
    mod_pow(x, m - 2, m)
}
pub struct Combination {
    m: i64,
    fact: Vec<i64>,
}
impl Combination {
    pub fn new(size: usize, m: i64) -> Self {
        let mut comb = Self {
            m,
            fact: Vec::new(),
        };
        comb.resize(size);
        comb
    }
    pub fn resize(&mut self, size: usize) {
        let old_len = self.fact.len();
        self.fact.resize(size + 1, 0);
        for i in old_len..=size {
            self.fact[i] = if i == 0 {
                1
            } else {
                i as i64 * self.fact[i - 1] % self.m
            };
        }
    }
    pub fn fact(&self, x: i64) -> i64 {
        self.fact[x as usize]
    }
    pub fn perm(&self, a: i64, b: i64) -> i64 {
        if a >= b {
            self.fact(a) * self.inv(self.fact(a - b)) % self.m
        } else {
            0
        }
    }
    pub fn comb(&self, a: i64, b: i64) -> i64 {
        if a >= b {
            self.fact(a) * self.inv(self.fact(b) * self.fact(a - b) % self.m) % self.m
        } else {
            0
        }
    }
    pub fn pow(&self, a: i64, b: i64) -> i64 {
        mod_pow(a, b, self.m)
    }
    pub fn inv(&self, x: i64) -> i64 {
        self.pow(x, self.m - 2)
    }
}

// -----------------------------------------------------------------------------
pub mod kyoproio {
    use std::io::prelude::*;
    pub trait Input {
        fn str(&mut self) -> &str;
        fn input<T: InputParse>(&mut self) -> T {
            T::input(self)
        }
        fn iter<T: InputParse>(&mut self) -> Iter<T, Self> {
            Iter(self, std::marker::PhantomData)
        }
        fn seq<T: InputParse, B: std::iter::FromIterator<T>>(&mut self, n: usize) -> B {
            self.iter().take(n).collect()
        }
    }
    pub struct KInput<R> {
        src: R,
        buf: String,
        pos: usize,
    }
    impl<R: BufRead> KInput<R> {
        pub fn new(src: R) -> Self {
            Self {
                src,
                buf: String::with_capacity(1024),
                pos: 0,
            }
        }
        pub fn src(&mut self) -> &mut R {
            &mut self.src
        }
    }
    impl<R: BufRead> Input for KInput<R> {
        fn str(&mut self) -> &str {
            loop {
                if self.pos >= self.buf.len() {
                    self.pos = 0;
                    self.buf.clear();
                    if self.src.read_line(&mut self.buf).expect("io error") == 0 {
                        return &self.buf;
                    }
                }
                let range = self.pos
                    ..self.buf[self.pos..]
                        .find(|c: char| c.is_ascii_whitespace())
                        .map(|i| i + self.pos)
                        .unwrap_or_else(|| self.buf.len());
                self.pos = range.end + 1;
                if range.end > range.start {
                    return &self.buf[range];
                }
            }
        }
    }
    pub struct Iter<'a, T, I: ?Sized>(&'a mut I, std::marker::PhantomData<*const T>);
    impl<'a, T: InputParse, I: Input + ?Sized> Iterator for Iter<'a, T, I> {
        type Item = T;
        fn next(&mut self) -> Option<T> {
            Some(self.0.input())
        }
    }
    pub trait InputParse: Sized {
        fn input<I: Input + ?Sized>(src: &mut I) -> Self;
    }
    impl InputParse for Vec<u8> {
        fn input<I: Input + ?Sized>(src: &mut I) -> Self {
            src.str().as_bytes().to_owned()
        }
    }
    macro_rules! from_str_impl {
        { $($T:ty)* } => {
            $(impl InputParse for $T {
                fn input<I: Input + ?Sized>(src: &mut I) -> Self {
                    src.str().parse::<$T>().expect("parse error")
                }
            })*
        }
    }
    from_str_impl! {
        String char bool f32 f64 isize i8 i16 i32 i64 i128 usize u8 u16 u32 u64 u128
    }
    macro_rules! tuple_impl {
        ($H:ident $($T:ident)*) => {
            impl<$H: InputParse, $($T: InputParse),*> InputParse for ($H, $($T),*) {
                fn input<I: Input + ?Sized>(src: &mut I) -> Self {
                    ($H::input(src), $($T::input(src)),*)
                }
            }
            tuple_impl!($($T)*);
        };
        () => {}
    }
    tuple_impl!(A B C D E F G);
    #[macro_export]
    macro_rules! kdbg {
        ($($v:expr),*) => {
            if cfg!(debug_assertions) { dbg!($($v),*) } else { ($($v),*) }
        }
    }
}


#![allow(dead_code, unused_macros, unused_imports)]
use std::{cell::{Cell, RefCell, UnsafeCell}, cmp::{Ordering, Reverse, max, min}, collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque, hash_map::{DefaultHasher, RandomState}}, error::Error, fmt::{Display, Write as FmtWrite}, hash::{BuildHasher, Hash, Hasher}, io::{BufWriter, Read, Stdin, Stdout, Write}, iter::{FromIterator, Peekable}, mem::swap, ops::*, process::exit, rc::Rc, str::{FromStr, from_utf8_unchecked}, time::{Duration, Instant}, convert::{TryInto, TryFrom}, marker::PhantomData};

const IO_BUF_SIZE: usize = 1 << 16;
type Input = Scanner<Stdin>;
type Output = BufWriter<Stdout>;
fn _init_input() -> Input { Scanner::new(std::io::stdin()) }
fn _init_output() -> Output { BufWriter::with_capacity(IO_BUF_SIZE, std::io::stdout()) }

#[repr(transparent)] struct Unsync<T>(T);
unsafe impl<T> Sync for Unsync<T> {}

type BadLazy<T> = Unsync<UnsafeCell<Option<T>>>;
impl<T> BadLazy<T> {
    const fn new() -> Self { Self(UnsafeCell::new(None)) }
}

static INPUT: BadLazy<Input> = BadLazy::new();
static OUTPUT: BadLazy<Output> = BadLazy::new();

fn inp<F: FnOnce(&mut Input) -> R, R>(f: F) -> R {
    unsafe { f((&mut *INPUT.0.get()).get_or_insert_with(_init_input)) }
}
fn out<F: FnOnce(&mut Output) -> R, R>(f: F) -> R {
    unsafe { f((&mut *OUTPUT.0.get()).get_or_insert_with(_init_output)) }
}

macro_rules! read {
    () => { read() };
    ($t: ty) => { read::<$t>() };
    ($t: ty, $($tt: ty),*) => { (read::<$t>(), $(read::<$tt>(),)*) };
    [$t: ty; $n: expr] => { read_vec::<$t>($n) };
}
macro_rules! println {
    () => { out(|x| { let _ = writeln!(x); }) };
    ($exp: expr) => { out(|x| { let _ = writeln!(x, "{}", $exp); }) };
    ($fmt: expr, $($arg : tt )*) => { out(|x| { let _ = writeln!(x, $fmt, $($arg)*); }) }
}
macro_rules! print {
    ($exp: expr) => { out(|x| { let _ = write!(x, "{}", $exp); }) };
    ($fmt: expr, $($arg : tt )*) => { out(|x| { let _ = write!(x, $fmt, $($arg)*); }) }
}

fn out_flush() { out(|x| { let _ = x.flush(); }); }

fn input_is_eof() -> bool { inp(|x| x.eof()) }
fn read_byte() -> u8 { inp(|x| x.byte()) }
fn read_bytes_no_skip(n: usize) -> Vec<u8> { inp(|x| x.bytes_no_skip(n)) }
fn read_bytes(n: usize) -> Vec<u8> { inp(|x| x.bytes(n)) }
fn read_bytes2(n: usize, m: usize) -> Vec<Vec<u8>> { inp(|x| x.bytes2(n, m)) }
fn read_token() -> Vec<u8> { inp(|x| x.token_bytes()) }
fn read_token_str() -> String { unsafe { String::from_utf8_unchecked(read_token()) } }
fn read_line() -> Vec<u8> { inp(|x| x.line_bytes()) }
fn read_line_str() -> String { unsafe { String::from_utf8_unchecked(read_line()) } }
fn read<T: FromStr>() -> T { read_token_str().parse::<T>().ok().expect("failed parse") }
fn read_vec<T: FromStr>(n: usize) -> Vec<T> { (0..n).map(|_| read()).collect() }
fn read_vec2<T: FromStr>(n: usize, m: usize) -> Vec<Vec<T>> { (0..n).map(|_| read_vec(m)).collect() }

struct Scanner<R: Read> {
    src: R,
    _buf: Vec<u8>,
    _pt: usize, // pointer
    _rd: usize, // bytes read
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(src: R) -> Scanner<R> {
        Scanner { src, _buf: vec![0; IO_BUF_SIZE], _pt: 1, _rd: 1 }
    }

    fn _check_buf(&mut self) {
        if self._pt == self._rd {
            self._rd = self.src.read(&mut self._buf).unwrap_or(0);
            self._pt = (self._rd == 0) as usize;
        }
    }

    // returns true if end of file
    fn eof(&mut self) -> bool {
        self._check_buf();
        self._rd == 0
    }

    // filters \r, returns \0 if eof
    fn byte(&mut self) -> u8 {
        loop {
            self._check_buf();
            if self._rd == 0 { return 0; }
            let res = self._buf[self._pt];
            self._pt += 1;
            if res != b'\r' { return res; }
        }
    }

    fn bytes_no_skip(&mut self, n: usize) -> Vec<u8> { (0..n).map(|_| self.byte()).collect() }
    fn bytes(&mut self, n: usize) -> Vec<u8> {
        let res = self.bytes_no_skip(n);
        self.byte();
        res
    }
    fn bytes2(&mut self, n: usize, m: usize) -> Vec<Vec<u8>> { (0..n).map(|_| self.bytes(m)).collect() }

    fn token_bytes(&mut self) -> Vec<u8> {
        let mut res = Vec::new();
        let mut c = self.byte();
        while c <= b' ' {
            if c == b'\0' { return res; }
            c = self.byte();
        }
        loop {
            res.push(c);
            c = self.byte();
            if c <= b' ' { return res; }
        }
    }

    fn line_bytes(&mut self) -> Vec<u8> {
        let mut res = Vec::new();
        let mut c = self.byte();
        while c != b'\n' && c != b'\0' {
            res.push(c);
            c = self.byte();
        }
        res
    }
}

trait JoinToStr {
    fn join_to_str(self, sep: &str) -> String;
    fn concat_to_str(self) -> String;
}
impl<T: Display, I: Iterator<Item = T>> JoinToStr for I {
    fn join_to_str(mut self, sep: &str) -> String {
        match self.next() {
            Some(first) => {
                let mut res = first.to_string();
                while let Some(item) = self.next() {
                    res.push_str(sep);
                    res.push_str(&item.to_string());
                }
                res
            }
            None => { String::new() }
        }
    }

    fn concat_to_str(self) -> String {
        let mut res = String::new();
        for item in self { res.push_str(&item.to_string()); }
        res
    }
}
trait AsStr { fn as_str(&self) -> &str; }
impl AsStr for [u8] { fn as_str(&self) -> &str {std::str::from_utf8(self).expect("attempt to convert non-UTF8 byte string.")} }

macro_rules! veci {
    ($n:expr , $i:ident : $gen:expr) => {{
        let _veci_n = $n;
        let mut _veci_list = Vec::with_capacity(_veci_n);
        for $i in 0.._veci_n {
            _veci_list.push($gen);
        }
        _veci_list
    }};
    ($n:expr , $gen:expr) => { veci!($n, _veci_: $gen) }
}

fn abs_diff<T: Sub<Output = T> + PartialOrd>(x: T, y: T) -> T {
    if x < y { y - x } else { x - y }
}

trait CommonNumExt {
    fn div_ceil(self, b: Self) -> Self;
    fn div_floor(self, b: Self) -> Self;
    fn gcd(self, b: Self) -> Self;
    fn highest_one(self) -> Self;
    fn lowest_one(self) -> Self;
    fn sig_bits(self) -> u32;
}

macro_rules! impl_common_num_ext {
    ($($ix:tt = $ux:tt),*) => {
        $(
            impl CommonNumExt for $ux {
                fn div_ceil(self, b: Self) -> Self {
                    let q = self / b; let r = self % b;
                    if r != 0 { q + 1 } else { q }
                }
                fn div_floor(self, b: Self) -> Self { self / b }
                fn gcd(self, mut b: Self) -> Self {
                    let mut a = self;
                    if a == 0 || b == 0 { return a | b; }
                    let shift = (a | b).trailing_zeros();
                    a >>= a.trailing_zeros();
                    b >>= b.trailing_zeros();
                    while a != b {
                        if a > b { a -= b; a >>= a.trailing_zeros(); }
                        else { b -= a; b >>= b.trailing_zeros(); }
                    }
                    a << shift
                }
                #[inline] fn highest_one(self) -> Self {
                    if self == 0 { 0 } else { const ONE: $ux = 1; ONE << self.sig_bits() - 1 }
                }
                #[inline] fn lowest_one(self) -> Self { self & self.wrapping_neg() }
                #[inline] fn sig_bits(self) -> u32 { std::mem::size_of::<$ux>() as u32 * 8 - self.leading_zeros() }
            }

            impl CommonNumExt for $ix {
                fn div_ceil(self, b: Self) -> Self {
                    let q = self / b; let r = self % b;
                    if self ^ b >= 0 && r != 0 { q + 1 } else { q }
                }
                fn div_floor(self, b: Self) -> Self {
                    let q = self / b; let r = self % b;
                    if self ^ b < 0 && r != 0 { q - 1 } else { q }
                }
                fn gcd(self, b: Self) -> Self {
                    fn w_abs(x: $ix) -> $ux { (if x.is_negative() { x.wrapping_neg() } else { x }) as _ }
                    w_abs(self).gcd(w_abs(b)) as _
                }
                #[inline] fn highest_one(self) -> Self { (self as $ux).highest_one() as _ }
                #[inline] fn lowest_one(self) -> Self { self & self.wrapping_neg() }
                #[inline] fn sig_bits(self) -> u32 { std::mem::size_of::<$ix>() as u32 * 8 - self.leading_zeros() }
            }
        )*
    }
}
impl_common_num_ext!(i8 = u8, i16 = u16, i32 = u32, i64 = u64, i128 = u128, isize = usize);

trait ChMaxMin<T> {
    fn chmax(&mut self, v: T) -> bool;
    fn chmin(&mut self, v: T) -> bool;
}
impl<T: PartialOrd> ChMaxMin<T> for Option<T> {
    fn chmax(&mut self, v: T) -> bool { if self.is_none() || v > *self.as_ref().unwrap() { *self = Some(v); true } else { false } }
    fn chmin(&mut self, v: T) -> bool { if self.is_none() || v < *self.as_ref().unwrap() { *self = Some(v); true } else { false } }
}
impl<T: PartialOrd> ChMaxMin<T> for T {
    fn chmax(&mut self, v: T) -> bool { if v > *self { *self = v; true } else { false } }
    fn chmin(&mut self, v: T) -> bool { if v < *self { *self = v; true } else { false } }
}

// * end commons * //

pub trait BinarySearchExt<T> {
    fn binary_search_by<F: FnMut(T) -> Ordering>(&self, f: F) -> Result<T, T>;

    fn partition_point<F: FnMut(T) -> bool>(&self, mut f: F) -> T {
        self.binary_search_by(|x| if f(x) { Ordering::Less } else { Ordering::Greater }).err().unwrap()
    }
}
macro_rules! impl_binary_search_ext_integer {
    ($($ty:tt),*) => {
        $(
            impl BinarySearchExt<$ty> for std::ops::Range<$ty> {
                fn binary_search_by<F: FnMut($ty) -> Ordering>(&self, mut f: F) -> Result<$ty, $ty> {
                    let mut low = self.start;
                    let mut high = self.end;

                    while low < high {
                        let mid = (low & high) + ((low ^ high) >> 1);
                        let cmp = f(mid);
                        if cmp == Ordering::Less {
                            low = mid + 1;
                        } else if cmp == Ordering::Greater {
                            high = mid;
                        } else {
                            return Ok(mid);
                        }
                    }
                    Err(low)
                }
            }
        )*
    }
}
impl_binary_search_ext_integer!(u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize);

#[allow(non_snake_case, non_upper_case_globals)]
fn main() {
    let num_cases: usize = 1;//read();

    for _case_num in 1..=num_cases {
		let n = read!(i64);

		let ans = if n < 3 {n*2+1} else {n*4/3 + 3};
		println!(ans);
    }

    out_flush();
}


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 a: usize = scan.next();
    let mut b: usize = scan.next();
    let mut c: usize = scan.next();
    b /= 2;
    c /= 4;
    let n = a.min(b).min(c);
    println!("{}", n * 7);
}

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


//spnauti-rust
use std::io::*;
use std::str::*;
use std::fmt::Debug;
#[allow(unused_imports)] use std::cmp::Ordering::*;
#[allow(unused_imports)] use std::collections::*;

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

#[allow(dead_code)]
fn build_counting_hashmap<K: Eq + std::hash::Hash, T>(i: T) -> HashMap<K,usize>
    where T: Iterator<Item = K> {
    let mut m = HashMap::new();
    for k in i {
        let n = 1 + if let Some(&n) = m.get(&k) { n } else { 0 };
        m.insert(k, n);
    }
    m
}

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

    let mut a = input.vi(3);
    let d = input.i();
    a.sort();
    println!("{}", 2 * d - (a[1] - a[0]).min(d) - (a[2] - a[1]).min(d));
}


fn input() -> u64 {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

fn main() {
    let n = input();
    println!("{}", (1..n).fold(0, |count, i| count + i * (n - i)) + n);
}


use std::io;
fn main() {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).unwrap();
    let n_a: Vec<usize> = buffer.split_whitespace().map(|x| x.parse::<usize>().unwrap()).collect();
    let (_, a) = (n_a[0], n_a[1] - 1);
    buffer.clear();
    io::stdin().read_line(&mut buffer).unwrap();
    let s: Vec<u32> = buffer.split_whitespace().map(|x| x.parse::<u32>().unwrap()).collect();
    let i: usize = a;
    let mut d: usize = 1;
    let mut ans: u32 = 0;
    if s[a] == 1 { ans += 1};
    loop {
        let left_idx = i.checked_sub(d);
        let right_idx = i + d;

        let left = match left_idx {
            Some(x) => Some(s[x]),
            None => None
        };

        let right = match right_idx {
            x if x < s.len() => Some(s[x]),
            _ => None
        };

        ans += match (left, right) {
            (Some(1), Some(1)) => 2,
            (None, Some(1)) => 1,
            (Some(1), None) => 1,
            _ => 0
        };

        if left.is_none() && right.is_none() {
            break;
        }

        d += 1
    }
    println!("{}", ans);
}


#![allow(unused_variables)]
#![allow(unused_must_use)]
#![allow(dead_code)]
use std::io::{self, prelude::*};

fn solve<R: BufRead, W: Write>(mut input: FastInput<R>, mut w: W) {
    let n: usize = input.token();
    let mut a = vec![0usize; n];
    for x in a.iter_mut() {
        *x = input.token();
    }
    let min = a.iter().min().unwrap();
    let cnt = a.iter().filter(|&x| x == min).count();
    if cnt > n / 2 {
        write!(w, "Bob\n");
    } else {
        write!(w, "Alice\n");
    }
}

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

trait TokenStream<T> {
    fn token(&mut self) -> T;
}

struct FastInput<R> {
    stdin: R,
    pos: usize,
}

impl<R: BufRead> From<R> for FastInput<R> {
    fn from(r: R) -> Self {
        FastInput { stdin: r, pos: 0 }
    }
}

impl<R: BufRead> TokenStream<u8> for FastInput<R> {
    fn token(&mut self) -> u8 {
        loop {
            if let Ok(buf) = self.stdin.fill_buf() {
                while self.pos < buf.len() {
                    self.pos += 1;
                    if buf[self.pos - 1] > 32 {
                        return buf[self.pos - 1];
                    }
                }
                if self.pos == 0 {
                    return 0;
                }
            } else {
                return 0;
            }
            self.stdin.consume(self.pos);
            self.pos = 0;
        }
    }
}

impl<R: BufRead> TokenStream<Vec<u8>> for FastInput<R> {
    fn token(&mut self) -> Vec<u8> {
        let mut ans = Vec::new();
        let mut parse_token = false;
        loop {
            if let Ok(buf) = self.stdin.fill_buf() {
                if !parse_token {
                    while self.pos < buf.len() && buf[self.pos] <= 32 {
                        self.pos += 1;
                    }
                }
                while self.pos < buf.len() && buf[self.pos] > 32 {
                    parse_token = true;
                    ans.push(buf[self.pos]);
                    self.pos += 1;
                }
                if self.pos != buf.len() || self.pos == 0 {
                    return ans;
                }
            }
            self.stdin.consume(self.pos);
            self.pos = 0;
        }
    }
}

macro_rules! impl_token_stream_u {
    ($($t:ident),+) => {$(
        impl<R: BufRead> TokenStream<$t> for FastInput<R> {
           fn token(&mut self) -> $t {
                let mut ans = 0;
                let mut parse_token = false;
                loop {
                    if let Ok(buf) = self.stdin.fill_buf() {
                        if !parse_token {
                            while self.pos < buf.len() && buf[self.pos] <= 32 {
                                self.pos += 1;
                            }
                        }
                        while self.pos < buf.len() && buf[self.pos] > 32 {
                            parse_token = true;
                            ans = ans * 10 + (buf[self.pos] - b'0') as $t;
                            self.pos += 1;
                        }
                        if self.pos != buf.len() || self.pos == 0 {
                            return ans;
                        }
                    }
                    self.stdin.consume(self.pos);
                    self.pos = 0;
                }
           }
        }
    )+}
}

pub trait Identity {
    fn identity() -> Self;
}

pub trait SelfIdentity {
    fn self_identity(&self) -> Self;
}

impl<T: Identity> SelfIdentity for T {
    fn self_identity(&self) -> Self {
        Self::identity()
    }
}

pub trait Inverse {
    fn inverse(self) -> Self;
}

macro_rules! define_modular_type {
    ($mod:ident, $value:expr) => {
        #[derive(Copy, Clone, Default, PartialEq)]
        struct $mod(u32);

        impl $mod {
            const MOD: u64 = $value;
        }

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

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

        impl<T: Into<u64>> From<T> for $mod {
            fn from(a: T) -> Self {
                $mod((a.into() % Self::MOD) as u32)
            }
        }

        impl Into<u32> for $mod {
            fn into(self) -> u32 {
                self.0
            }
        }

        impl Identity for $mod {
            fn identity() -> Self {
                1u32.into()
            }
        }

        impl Inverse for $mod {
            fn inverse(self) -> Self {
                let mut t = (Self::default(), Self::identity());
                let mut r = (Self::MOD, self.0 as u64);
                while r.1 != 0 {
                    let q = r.0 / r.1;
                    t = (t.1, t.0 - t.1 * q.into());
                    r = (r.1, r.0 - r.1 * q);
                }
                t.0
            }
        }

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

        impl std::ops::AddAssign for $mod {
            fn add_assign(&mut self, rhs: Self) {
                self.0 += rhs.0;
                if self.0 >= Self::MOD as u32 {
                    self.0 -= Self::MOD as u32;
                }
            }
        }

        impl std::ops::Neg for $mod {
            type Output = Self;
            fn neg(self) -> Self::Output {
                $mod(Self::MOD as u32 - self.0)
            }
        }

        impl std::ops::Sub for $mod {
            type Output = $mod;
            fn sub(self, rhs: Self) -> Self::Output {
                if self.0 < rhs.0 {
                    $mod(self.0 + (Self::MOD as u32) - rhs.0)
                } else {
                    $mod(self.0 - rhs.0)
                }
            }
        }

        impl std::ops::SubAssign for $mod {
            fn sub_assign(&mut self, rhs: Self) {
                if self.0 < rhs.0 {
                    self.0 += Self::MOD as u32;
                }
                self.0 -= rhs.0
            }
        }

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

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

        impl std::ops::Div for $mod {
            type Output = Self;
            fn div(self, rhs: Self) -> Self::Output {
                self * rhs.inverse()
            }
        }

        impl std::ops::DivAssign for $mod {
            fn div_assign(&mut self, rhs: Self) {
                *self = *self / rhs;
            }
        }
    };
}

#[derive(Clone)]
pub struct Matrix<T> {
    data: Vec<T>,
    cols: usize,
    rows: usize,
}

impl<T> Matrix<T>
where
    T: std::default::Default + Clone,
{
    pub fn new(rows: usize, cols: usize) -> Matrix<T> {
        let data = vec![T::default(); cols * rows];
        Matrix {
            data: data,
            cols: cols,
            rows: rows,
        }
    }
}

impl<T> Matrix<T> {
    pub fn rows(&self) -> std::slice::Chunks<T> {
        self.data.chunks(self.cols)
    }
    pub fn rows_mut(&mut self) -> std::slice::ChunksMut<T> {
        self.data.chunks_mut(self.cols)
    }
    pub fn elem(&self, row: usize, col: usize) -> &T {
        &self.data[self.cols * row + col]
    }
    pub fn elem_mut(&mut self, row: usize, col: usize) -> &mut T {
        &mut self.data[self.cols * row + col]
    }
}

impl<T> std::fmt::Debug for Matrix<T>
where
    T: std::fmt::Debug,
{
    fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
        self.rows()
            .try_for_each(|row| fmt.write_fmt(format_args!("{:?}\n", row)))
    }
}

impl<T> SelfIdentity for Matrix<T>
where
    T: Identity + std::default::Default + Clone,
{
    fn self_identity(&self) -> Self {
        assert_eq!(self.cols, self.rows);
        let mut ret = Matrix::new(self.rows, self.cols);
        for (i, row) in ret.rows_mut().enumerate() {
            row[i] = T::identity();
        }
        ret
    }
}

impl<T> std::ops::Add for Matrix<T>
where
    T: Clone + std::default::Default + std::ops::Add<Output = T>,
{
    type Output = Matrix<T>;
    fn add(self, rhs: Matrix<T>) -> Matrix<T> {
        assert_eq!(self.cols, rhs.cols);
        assert_eq!(self.rows, rhs.rows);
        Matrix {
            data: self
                .data
                .iter()
                .zip(rhs.data)
                .map(|(a, b)| a.clone() + b.clone())
                .collect(),
            rows: self.rows,
            cols: self.cols,
        }
    }
}
impl<T> std::ops::Sub for Matrix<T>
where
    T: Clone + std::default::Default + std::ops::Sub<Output = T>,
{
    type Output = Matrix<T>;
    fn sub(self, rhs: Matrix<T>) -> Matrix<T> {
        assert_eq!(self.cols, rhs.cols);
        assert_eq!(self.rows, rhs.rows);
        Matrix {
            data: self
                .data
                .iter()
                .zip(rhs.data)
                .map(|(a, b)| a.clone() - b.clone())
                .collect(),
            rows: self.rows,
            cols: self.cols,
        }
    }
}
impl<T> std::ops::Mul for Matrix<T>
where
    T: Clone + std::default::Default + std::ops::AddAssign + std::ops::Mul<Output = T>,
{
    type Output = Matrix<T>;
    fn mul(self, rhs: Matrix<T>) -> Matrix<T> {
        assert_eq!(self.cols, rhs.rows);
        let mut ret: Matrix<T> = Matrix::new(self.rows, rhs.cols);
        for (ret_row, self_row) in ret.rows_mut().zip(self.rows()) {
            for (rhs_row, self_el) in rhs.rows().zip(self_row) {
                for (ret_el, rhs_el) in ret_row.iter_mut().zip(rhs_row) {
                    *ret_el += self_el.clone() * rhs_el.clone();
                }
            }
        }
        ret
    }
}

fn binary_power<T>(a: &T, mut exp: u64) -> T
where
    T: Clone + std::ops::Mul<Output = T> + SelfIdentity,
{
    let mut base = a.clone();
    let mut acc = a.self_identity();
    while exp > 1 {
        if (exp & 1) == 1 {
            acc = acc * base.clone();
        }
        exp /= 2;
        base = base.clone() * base.clone();
    }
    if exp == 1 {
        acc = acc * base;
    }
    acc
}

impl_token_stream_u!(usize);
define_modular_type!(MOD7, 1_000_000_007);


use std::iter::*;
use std::str::SplitWhitespace;
use std::io::{stdin, BufReader, Stdin};
use std::io::prelude::*;
use std::collections::hash_map::HashMap;
use std::collections::hash_set::HashSet;
use std::string::*;

fn main() {
    let mut buf = String::new();
    stdin().read_line(&mut buf);
    let s: usize = vec!["Danil", "Olya", "Slava", "Ann", "Nikita"]
        .iter()
        .map(|&s| buf.matches(s).count())
        .sum();
    println!("{}", if s == 1 { "YES" } else { "NO" });
}


use std::{io::stdin, iter};

fn find_smallest(n: usize, l: usize) -> usize {
    let remaining = l - 1;
    let mut res: Vec<usize> = iter::repeat(1).take(n - remaining).collect();
    for i in n - remaining..n {
        res.push(res[i - 1] * 2);
    }
    res.iter().sum()
}

fn find_biggest(n: usize, r: usize) -> usize {
    let remaining = r - 1;
    let mut res: Vec<usize> = iter::repeat(2usize.pow(remaining as u32))
        .take(n - remaining)
        .collect();
    for i in n - remaining..n {
        res.push(res[i - 1] / 2);
    }
    res.iter().sum()
}

fn main() {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let mut buf = buf
        .trim()
        .split_whitespace()
        .map(|c| c.parse::<usize>().unwrap());
    let (n, l, r) = (
        buf.next().unwrap(),
        buf.next().unwrap(),
        buf.next().unwrap(),
    );

    println!("{} {}", find_smallest(n, l), find_biggest(n, r));
}


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 factorize(n: i64) -> Vec<i64> {
    let mut n = n;
    let mut ans = Vec::new();
    let mut d = 2;
    while d * d <= n {
        while n % d == 0 {
            ans.push(d);
            n /= d;
        }
        d += 1;
    }
    if n > 1 {
        ans.push(n);
    }
    ans
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let n: i64 = scan.token();
    let k: i64 = scan.token();

    let factors = factorize(n);
    let num_factors = factors.len() as i64;
    if num_factors < k {
        writeln!(out, "-1").ok();
        return;
    }
    // Choose (k - 1) factors individually.
    // Make the k-th factor the product of the rest of the factors.
    for i in 0..(k - 1) {
        write!(out, "{} ", factors[i as usize]).ok();
    }
    let mut last_factor = 1;
    for i in (k - 1)..num_factors {
        last_factor *= factors[i as usize];
    }
    writeln!(out, "{}", last_factor).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::io::*;

fn main() {
    let mut k = String::new();
    stdin().read_line(&mut k);
    let mut flag = false;
    let mut cnt = 0;
    for x in k.chars() {
        if !flag && x == '1' {
            flag = true;
        }
        if flag && x == '0' {
            cnt += 1;
        }
    }
    if flag && cnt >= 6 {
        println!("yes");
    } else {
        println!("no");
    }
}


use std::io;

fn solve() -> Vec<String> {
    let mut input = "".split_ascii_whitespace();
    let mut read = || loop {
        if let Some(word) = input.next() {
            break word;
        }
        input = {
            let mut input = "".to_owned();
            io::stdin().read_line(&mut input).unwrap();
            if input.is_empty() {
                panic!("reached EOF");
            }
            Box::leak(input.into_boxed_str()).split_ascii_whitespace()
        };
    };
    macro_rules! read(($ty:ty) => (read().parse::<$ty>().unwrap()));

    let mut rr = vec!["".to_string(); 0];

    let t = 1;
    for _ in 0..t {
        let n = read!(usize);
        let ca = read!(String).chars().collect::<Vec<char>>();

        let mut a = vec![' '; n];
        let mut b = vec![' '; n];
        for i in 0..n {
            a[i] = ca[i];
            b[i] = ca[i + n];
        }

        a.sort();
        b.sort();
        let mut t = 0;
        for i in 0..n {
            if a[i] < b[i] {
                t |= 1;
            } else if a[i] > b[i] {
                t |= 2;
            } else {
                t |= 4;
            }
        }

        if t < 3 {
            rr.push("YES".to_string());
        } else {
            rr.push("NO".to_string());
        }
    }

    rr
}

#[allow(dead_code)]
fn main() {
    let output = solve();
    println!("{}", output.join("\n"));
}


use std::cmp::*;
use std::collections::*;
use std::io::*;
use std::str::*;

// scanner from https://codeforces.com/contest/1396/submission/91365784
struct Scanner {
    stdin: Stdin,
    buffer: VecDeque<String>,
}
#[allow(dead_code)]
impl Scanner {
    fn new() -> Self {
        Scanner {
            stdin: stdin(),
            buffer: VecDeque::new(),
        }
    }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.is_empty() {
            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));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.cin::<String>().chars().collect()
    }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.cin()).collect()
    }
    fn u(&mut self) -> usize {
        self.cin()
    }
    fn vecu(&mut self, n: usize) -> Vec<usize> {
        self.vec(n)
    }
}

#[derive(Clone, Debug, Default)]
struct Solver {}

impl Solver {
    fn solve(&mut self, scan: &mut Scanner, out: &mut BufWriter<Stdout>) {
        // 1426e
        let n = scan.u();
        let a = scan.vecu(3);
        let b = scan.vecu(3);

        let maxwin = min(a[0], b[1]) + min(a[1], b[2]) + min(a[2], b[0]);
        let tmp = max(max(a[0] + b[1], a[1] + b[2]), a[2] + b[0]);
        let minwin = tmp.saturating_sub(n);

        writeln!(out, "{} {}", minwin, maxwin).ok();
    }
}

fn solve() {
    let mut scan = Scanner::new();
    let out = &mut BufWriter::new(stdout());

    let testcase = 1;
    //let testcase: usize = scan.cin();
    for _ in 0..testcase {
        let mut s: Solver = Default::default();
        s.solve(&mut scan, out);
    }
}

fn main() {
    let th = std::thread::Builder::new().stack_size(64 * 1024 * 1024);
    th.spawn(|| solve()).unwrap().join().unwrap()
}


// ---------- begin ModInt ----------
const MOD: u32 = 998_244_353;
#[derive(Clone, Copy)]
struct ModInt(u32);

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

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

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

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

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

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

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

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

impl std::str::FromStr for ModInt {
    type Err = std::num::ParseIntError;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        let val = s.parse::<u32>()?;
        Ok(ModInt::new(val))
    }
}

#[allow(dead_code)]
impl ModInt {
    pub fn new(v: u32) -> ModInt {
        ModInt(v % 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 = t * s;
            }
            s = s * s;
            n >>= 1;
        }
        t
    }
    pub fn inv(self) -> ModInt {
        self.pow(MOD - 2)
    }
}
// ---------- end ModInt ----------
// ---------- begin Precalc ----------
#[allow(dead_code)]
struct Precalc {
    n: usize,
    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 {
            n: n,
            inv: inv,
            fact: fact,
            ifact: ifact,
        }
    }
    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 {
        self.fact[n] * self.ifact[k] * self.ifact[n - k]
    }
    pub fn inv(&self, n: usize) -> ModInt {
        self.inv[n]
    }
}

// ---------- end Precalc ----------
// ---------- begin NTT ----------
fn ntt(f: &mut [ModInt]) {
    let n = f.len();
    assert!(n.count_ones() == 1);
    let len = n.trailing_zeros() as usize;
    for i in 1..(n - 1){
        let mut x = i;
        let mut j = 0;
        for _ in 0..len {
            j = (j << 1) | (x & 1);
            x >>= 1;
        }
        if i < j {
            f.swap(i, j);
        }
    }
    for k in 0..(n.trailing_zeros() as usize) {
        let m = 1 << k;
        let z = ModInt(3).pow((MOD - 1) >> (k + 1) as u32);
        for f in f.chunks_mut(2 * m) {
            let mut q = ModInt::one();
            let (x, y) = f.split_at_mut(m);
            for (x, y) in x.iter_mut().zip(y.iter_mut()) {
                let a = *x;
                let b = q * *y;
                *x = a + b;
                *y = a - b;
                q *= z;
            }
        }
    }
}

fn intt(f: &mut [ModInt]) {
    ntt(f);
    f[1..].reverse();
    let ik = ModInt(f.len() as u32).inv();
    for f in f.iter_mut() {
        *f *= ik;
    }
}

fn multiply(a: &[ModInt], b: &[ModInt]) -> Vec<ModInt> {
    let n = a.len() + b.len() - 1;
    let mut k = 1;
    while k < n {
        k *= 2;
    }
    assert!(k <= (1 << 23));
    let mut f = Vec::with_capacity(k);
    let mut g = Vec::with_capacity(k);
    f.extend_from_slice(a);
    f.resize(k, ModInt::zero());
    ntt(&mut f);
    g.extend_from_slice(b);
    g.resize(k, ModInt::zero());
    ntt(&mut g);
    for (f, g) in f.iter_mut().zip(g.iter()) {
        *f *= *g;
    }
    intt(&mut f);
    f.truncate(n);
    f
}

// ---------- end NTT ----------

fn run() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let mut it = s.trim().split_whitespace();
    let mut n: usize = it.next().unwrap().parse().unwrap();
    let m: u32 = it.next().unwrap().parse().unwrap();
    let k: usize = it.next().unwrap().parse().unwrap();
    let p = ModInt(m).inv();
    let pc = Precalc::new(k);
    let mut t = vec![ModInt::zero(); k + 1];
    let mut s = vec![p; k + 1];
    t[0] = ModInt::one();
    s[0] = ModInt::one();
    for (i, s) in s.iter_mut().enumerate() {
        *s *= pc.ifact(i);
    }
    while n > 0 {
        if n & 1 == 1 {
            t = multiply(&t, &s);
            t.truncate(k + 1);
        }
        s = multiply(&s, &s);
        s.truncate(k + 1);
        n >>= 1;
    }
    let ans = t[k] * pc.fact(k);
    println!("{}", ans);
}

fn main() {
    run();
}


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 extended_euclid(a: i64, b: i64) -> (i64, i64, i64) {
    if b == 0 {
        (a, 1, 0)
    } else {
        let (d0, x0, y0) = extended_euclid(b, a % b);
        (d0, y0, x0 - a / b * y0)
    }
}

fn main() {
    let a: Vec<u32> = get_vec();

    let sum: u32 = a.iter().cloned().sum();

    if sum % 2 != 0 {
        println!("NO");
        return;
    }

    for i in 0..6 {
        for j in i + 1..6 {
            for k in j + 1..6 {
                if a[i] + a[j] + a[k] == sum / 2 {
                    println!("YES");
                    return;
                }
            }
        }
    }

    println!("NO");
}


use std::io;

fn read_line() -> String {
    let mut line = String::new();
    match io::stdin().read_line(&mut line) {
        Ok(_) => line.trim().to_string(),
        _ => panic!("QQ"),
    }
}

fn main() {
    let mut ans: u32 = 1;
    let n = read_line().parse::<u32>().unwrap();
    for i in 1..n {
        ans = ans * (i + n - 1) / i;
    }
    println!("{}", ans);
}


#[allow(unused_imports)] use std::{*, io::*, };
#[allow(unused)] 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)*} }; }
#[allow(unused)] 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)] 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")};}
#[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()); }

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    #[allow(unused)] macro_rules! puts { ($($format:tt)*) => (let _ = write!(out,$($format)*);); }
    input!{
        a: (i64, i64),
        b: (i64, i64),
        c: (i64, i64),
    }
    puts!(
        "{}",
        if (a.0 - b.0).pow(2) + (a.1 - b.1).pow(2) == (b.0 - c.0).pow(2) + (b.1 - c.1).pow(2)
        && (b.0 - a.0) * (c.1 - b.1) != (b.1 - a.1) * (c.0 - b.0)
        {"Yes"} else {"No"}
    );
}

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(dead_code)]
fn get_word() -> String {
      let stdin = std::io::stdin();
      let mut stdin=stdin.lock();
      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() }

// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8


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


use std::io;

fn to_square(line: &str) -> Vec<(i32, i32)> {
	let mut iter = line.trim().split_whitespace();
	let mut ret = Vec::new();
	while let Some(x) = iter.next() {
		ret.push((x.parse().unwrap(),
		          iter.next().unwrap().parse().unwrap()));
	}
	ret.sort();
	return ret
}

fn solve_square1(s1: &Vec<(i32, i32)>, x: i32) -> Option<(i32, i32)> {
	if x < s1[0].0 || x > s1[3].0 { return None; }
	return Some((s1[0].1, s1[3].1));
}

fn solve_square2(s2: &Vec<(i32, i32)>, x: i32) -> Option<(i32, i32)> {
	let x1 = s2[0].0;
	let x2 = s2[3].0;
	let y0 = s2[0].1;
	if x < x1 || x > x2 { return None; }
	let d = if x < s2[1].0 {
		x - x1
	} else {
		s2[3].0 - x
	};
	return Some((y0 - d, y0 + d));
}

fn solve(s1: Vec<(i32, i32)>, s2: Vec<(i32, i32)>) -> bool {
	let mut xs = Vec::new();
	for (x, _) in &s1 { xs.push(x); }
	for (x, _) in &s2 { xs.push(x); }
	xs.sort();
	xs.dedup();
	for x in xs {
		if let Some((lo1, hi1)) = solve_square1(&s1, *x) {
			if let Some((lo2, hi2)) = solve_square2(&s2, *x) {
				let lo = if lo1 < lo2 { lo2 } else { lo1 };
				let hi = if hi1 < hi2 { hi1 } else { hi2 };
				if lo <= hi { return true; }
			}
		}
	}
	return false;
}

fn main() -> io::Result<()> {
	let f = io::stdin();
	let mut line = String::new();
	f.read_line(&mut line)?;
	let s1 = to_square(&line);
	line.clear();
	f.read_line(&mut line)?;
	let s2 = to_square(&line);
	println!("{}", if solve(s1, s2) { "YES" } else { "NO" });

	Ok(())
}


macro_rules! parse_line {
    ($t: ty) => ({
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        let a_str = a_str.trim();
        a_str.parse::<$t>().expect("parse error")
    });
    ($($t: ty),+) => ({
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        let mut a_iter = a_str.split_whitespace();
        (
            $(
            a_iter.next().unwrap().parse::<$t>().expect("parse error"),
            )+
        )
    })
}

macro_rules! parse_line_to_vec {
    ($t: ty) => {{
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        (a_str
            .split_whitespace()
            .map(|x| x.parse::<$t>().unwrap())
            .collect::<Vec<$t>>())
    }};
}

fn solve() {
    let field: Vec<Vec<u8>> = (0..10).map(|_| parse_line!(String).bytes().collect()).collect();
    let mut ok = false;
    for i in 0..10 {
        for j in 0..10 {
            if i + 5 <= 10 {
                let mut xs = 0;
                let mut os = 0;
                for d in 0..5 {
                    if field[i + d][j] == b'X' {
                        xs += 1;
                    }else if field[i + d][j] == b'O' {
                        os += 1;
                    }
                }
                if os == 0 && xs >= 4 {
                    ok = true;
                }
            }
            if j + 5 <= 10 {
                let mut xs = 0;
                let mut os = 0;
                for d in 0..5 {
                    if field[i][j + d] == b'X' {
                        xs += 1;
                    }else if field[i][j + d] == b'O' {
                        os += 1;
                    }
                }
                if os == 0 && xs >= 4 {
                    ok = true;
                }
            }
            if i + 5 <= 10 && j + 5 <= 10 {
                let mut xs = 0;
                let mut os = 0;
                for d in 0..5 {
                    if field[i + d][j + d] == b'X' {
                        xs += 1;
                    }else if field[i + d][j + d] == b'O' {
                        os += 1;
                    }
                }
                if os == 0 && xs >= 4 {
                    ok = true;
                }
            }
            if i + 5 <= 10 && j >= 4 {
                let mut xs = 0;
                let mut os = 0;
                for d in 0..5 {
                    if field[i + d][j - d] == b'X' {
                        xs += 1;
                    }else if field[i + d][j - d] == b'O' {
                        os += 1;
                    }
                }
                if os == 0 && xs >= 4 {
                    ok = true;
                }
            }
        }
    }
    println!("{}", if ok {"YES"} else {"NO"});
}

fn main() {
    let tests = 1; // parse_line!(usize);
    for _ in 0..tests {
        solve();
    }
}


macro_rules! parse_line {
    ($t: ty) => ({
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        let a_str = a_str.trim();
        a_str.parse::<$t>().expect("parse error")
    });
    ($($t: ty),+) => ({
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        let mut a_iter = a_str.split_whitespace();
        (
            $(
            a_iter.next().unwrap().parse::<$t>().expect("parse error"),
            )+
        )
    })
}

macro_rules! parse_line_to_vec {
    ($t: ty) => {{
        let mut a_str = String::new();
        std::io::stdin().read_line(&mut a_str).expect("read error");
        (a_str
            .split_whitespace()
            .map(|x| x.parse::<$t>().unwrap())
            .collect::<Vec<$t>>())
    }};
}

fn solve_one(pos: usize, col: usize, c: &Vec<usize>) -> usize {
    let mut s = Vec::new();
    let mut result = 0;
    for i in 0..=c.len() {
        let val = if i < pos {c[i]} else if i > pos {c[i - 1]} else {col};
        if s.is_empty() {
            s.push((val, 1));
        }else if s.last().unwrap().0 == val {
            s.last_mut().unwrap().1 += 1;
        }else{
            if s.last().unwrap().1 > 2 {
                result += s.pop().unwrap().1;
            }
            if s.is_empty() {
                s.push((val, 1));
            }else if s.last().unwrap().0 == val {
                s.last_mut().unwrap().1 += 1;
            }else{
                s.push((val, 1));
            }
        }
    }
    if let Some((_col, cnt)) = s.last() {
        if *cnt > 2 {
            result += cnt;
        }
    }
    return if result > 0 {
        result - 1
    }else{
        0
    }
}

fn solve() {
    let (n, _k, x) = parse_line!(usize, usize, usize);
    let c = parse_line_to_vec!(usize);
    let mut result = 0;
    for i in 0..=n {
        result = std::cmp::max(result, solve_one(i, x, &c));
    }
    println!("{}", result)
}

fn main() {
    let tests = 1; // parse_line!(usize);
    for _ in 0..tests {
        solve();
    }
}


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!(isize);
impl_scan_single!(f32);
impl_scan_single!(f64);
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() {
  #[allow(unused_imports)]
  use std::io::{self, BufReader, BufRead, Write, BufWriter};
  let __stdin = io::stdin();
  let __stdout = io::stdout();
  let mut __in = BufReader::with_capacity(4096, __stdin.lock());
  let mut __buf = String::new();
  let mut __out = BufWriter::with_capacity(4096, __stdout.lock());

  macro_rules! scanln {
    ($($var:ident : $ty:path),+) => {
      $(let $var: $ty;)+
      {
        __buf.clear();
        __in.read_line(&mut __buf).unwrap();
        let mut eles = __buf.trim().split_whitespace();
        $($var = Scan::scan(&mut eles);)+
      }
    }
  }

  macro_rules! put {
    ($fmt:expr) => { write!(__out, $fmt).unwrap(); };
    ($fmt:expr, $($arg:expr),+) => { write!(__out, $fmt, $($arg),+).unwrap(); }
  }
  macro_rules! putln {
    () => { writeln!(__out, "").unwrap(); };
    ($fmt:expr) => { writeln!(__out, $fmt).unwrap(); };
    ($fmt:expr, $($arg:expr),+) => { writeln!(__out, $fmt, $($arg),+).unwrap(); }
  }
  macro_rules! fflush {
    () => { __out.flush().unwrap(); }
  }

  // -- PLACE SOLUTION BODY BELOW THIS LINE ------------------------------------

  scanln!(l: u32, r: u32, x: u32, y: u32, k: u32);

  let mut cost = 1;
  let mut exp = k;
  let mut found = false;

  while exp <= r && cost <= y {
    if exp >= l && cost >= x {
      found = true;
      break;
    }
    exp += k;
    cost += 1;
  }

  putln!("{}", if found { "YES" } else { "NO" });
}


use std::io;
fn read_line() -> String {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).unwrap();
    String::from(buffer.trim())
}
fn read_number() -> i64 {
    read_line().parse::<i64>().unwrap()
}
fn read_nums() -> Vec<usize> {
    read_line().split(' ').map(|x| x.parse::<usize>().unwrap()).collect()
}

fn main() {
    let nsk = read_nums();
    let (n, s, k) = (nsk[0] as usize, nsk[1] - 1, nsk[2]);
    let candies = read_nums();
    let colors = read_line().chars().collect::<Vec<char>>();
    let mut shortest: Vec<Vec<Option<i64>>> = vec![vec![None; 50 * n + 1]; n];
    for i in 0..n {
        shortest[i][candies[i]] = Some((i as i64 - s as i64).abs());
    }
    for candy_num in 1..(50usize*n+1) {
        for ind in 0..n {
            if let Some(mut dist) = shortest[ind][candy_num] {
                for jnd in 0..n {
                    if colors[ind] != colors[jnd] && candies[jnd] > candies[ind] {
                        let total_candies = candy_num + candies[jnd];
                        let path = dist + (jnd as i64 - ind as i64).abs();
                        if let Some(old) = shortest[jnd][total_candies] {
                            shortest[jnd][total_candies] = Some(std::cmp::min(old, path));
                        } else {
                            shortest[jnd][total_candies] = Some(path);
                        }
                    }
                }
            }
        }
    }
    let mut ans: Option<i64> = None;
    for candy_num in k..(50usize*n+1) {
        for ind in 0..n {
            if let Some(mut dist) = shortest[ind][candy_num] {
                ans = Some(
                    match ans {
                        Some(old_ans) => std::cmp::min(old_ans, dist),
                        None => dist,
                    }
                );
            }
        }
    }
    println!("{}", ans.unwrap_or(-1));
}


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 n1: usize = scan.next();
    let n2: usize = scan.next();
    let _k1: usize = scan.next();
    let _k2: usize = scan.next();
    println!("{}", if n2>=n1 {"Second"} else {"First"});
}

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


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

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 parse_t<T : FromStr>(s : &str) -> T {
    match s.trim().parse() {
        Ok(y) => y,
        Err(_) => panic!("Could not read from string!"),
    }
}

fn read_t<T : FromStr>(stdin : &Stdin) -> T {
    let mut line = String::new();
    read_line(stdin, &mut line);
    parse_t(&line)
}

fn digit_indices(ds : &Vec<u64>, di : &mut Vec<Vec<usize>>) {
    di.clear();
    for _ in 0 .. 10 {
        let ev = vec![];
        di.push(ev);
    }
    for i in 0 .. ds.len() {
        di[ds[i] as usize].push(i);
    }
}

fn digits(n : u64, ds : &mut Vec<u64>) {
    ds.clear();
    if n == 0 {
        ds.push(0);
    } else {
        let mut x = n;
        loop {
            if x == 0 {
                break;
            } else {
                let x_mod_10 = x % 10;
                let x_div_10 = x / 10;
                ds.push(x_mod_10);
                x = x_div_10;
            }
        }
    }
}

fn move_digits(from : usize, to : usize, dgts : &mut Vec<u64>) -> u64 {
    let mut num_swaps = 0;
    let dgt_from = dgts[from];
    let mut idx = from - 1;
    loop {
        if idx == to {
            dgts[idx + 1] = dgts[idx];
            dgts[idx] = dgt_from;
            num_swaps = num_swaps + 1;
            break;
        } else {
            dgts[idx + 1] = dgts[idx];
            idx = idx - 1;
            num_swaps = num_swaps + 1;
        }
    }
    num_swaps
}

fn swap_zero_out(from : usize, to : usize, dgts : &mut Vec<u64>) -> Option<u64> {
    if from < 2 {
        None
    } else {
        let mut found = false;
        let mut idx = from - 2;
        if idx < to {
            None
        } else {
            loop {
                if idx == to {
                    if dgts[idx] == 0 {
                        // Do nothing ...
                    } else {
                        found = true;
                    }
                    break;
                } else {
                    if dgts[idx] == 0 {
                        idx = idx - 1;
                    } else {
                        found = true;
                        break;
                    }
                }
            }
            if found {
                let num_swaps = move_digits(from - 1, idx, dgts);
                Some(num_swaps)
            } else {
                None
            }
        }
    }
}

fn swap_to_index(from : usize, to : usize, dgts : &mut Vec<u64>) -> Option<u64> {
    if from < to {
        panic!("Check failed: from({}) >= to({}).", from, to);
    } else if from == to {
        Some(0)
    } else {
        let num_dgts = dgts.len();
        if from == (num_dgts - 1) {
            // From is the highest digit, we have to check whether
            // the digit immediately to the right of it is a zero.
            if dgts[from - 1] == 0 {
                // We have to swap zero out of its location.
                match swap_zero_out(from, to, dgts) {
                    None => None,
                    Some(x) => {
                        let y = move_digits(from, to, dgts);
                        let num_swaps = x + y;
                        Some(num_swaps)
                    },
                }
            } else {
                // We don't have to worry about swapping a zero into
                // the highest digit.
                let num_swaps = move_digits(from, to, dgts);
                Some(num_swaps)
            }
        } else {
            // From is not the highest digit, so we need not
            // worry about swapping a zero into its place.
            let num_swaps = move_digits(from, to, dgts);
            Some(num_swaps)
        }
    }
}

fn num_swaps_for_digits(n : u64,
                        d_1 : usize,
                        m_1 : usize,
                        d_2 : usize,
                        m_2 : usize) -> Option<u64> {
    let mut dgts = vec![];
    digits(n, &mut dgts);
    let mut dgt_indxs = vec![];
    digit_indices(&dgts, &mut dgt_indxs);
    let mut could_swap = true;
    let mut num_swaps = u64::max_value();
    match swap_to_index(dgt_indxs[d_1][m_1], 0, &mut dgts) {
        None => {
            could_swap = false;
        },
        Some(x) => {
            num_swaps = x;
        },
    };
    if could_swap {
        let mut could_swap_2 = true;
        digit_indices(&dgts, &mut dgt_indxs);
        match swap_to_index(dgt_indxs[d_2][m_2], 1, &mut dgts) {
            None => {
                could_swap_2 = false;
            },
            Some(x) => {
                num_swaps = num_swaps + x;
            },
        };
        if could_swap_2 {
            Some(num_swaps)
        } else {
            None
        }
    } else {
        None
    }
}

fn num_swaps_to_divisible_by_25(n : u64) -> Option<u64> {
    let mut dgts = vec![];
    digits(n, &mut dgts);
    let mut dgt_indxs = vec![];
    digit_indices(&dgts, &mut dgt_indxs);
    let num_digits = dgts.len();
    // Check for at least two digits.
    if num_digits < 2 {
        None
    } else {
        let mut min_num_swaps = u64::max_value();
        // Check for two zeros.
        if dgt_indxs[0].len() >= 2 {
            // We have to swap the digits into place...
            match num_swaps_for_digits(n, 0, 0, 0, 1) {
                None => (),
                Some(x) => {
                    if x < min_num_swaps {
                        min_num_swaps = x;
                    }
                }
            }
        }
        if (dgt_indxs[0].len() >= 1) && (dgt_indxs[5].len() >= 1) {
            match num_swaps_for_digits(n, 0, 0, 5, 0) {
                None => (),
                Some(x) => {
                    if x < min_num_swaps {
                        min_num_swaps = x;
                    }
                }
            }
        }
        if (dgt_indxs[2].len() >= 1) && (dgt_indxs[5].len() >= 1) {
            match num_swaps_for_digits(n, 5, 0, 2, 0) {
                None => (),
                Some(x) => {
                    if x < min_num_swaps {
                        min_num_swaps = x;
                    }
                }
            }
        }
        if (dgt_indxs[7].len() >= 1) && (dgt_indxs[5].len() >= 1) {
            match num_swaps_for_digits(n, 5, 0, 7, 0) {
                None => (),
                Some(x) => {
                    if x < min_num_swaps {
                        min_num_swaps = x;
                    }
                }
            }
        }
        if min_num_swaps < u64::max_value() {
            Some(min_num_swaps)
        } else {
            None
        }
    }
}

fn main() {
    let stdin = io::stdin();
    let n = read_t(&stdin);
    match num_swaps_to_divisible_by_25(n) {
        None => println!("-1"),
        Some(s) => println!("{}", s),
    }
}


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 next_n<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.next::<T>()).collect()
    }
}

fn _main() {
    let mut scan = Scan::new();
    let mut arr: Vec<usize> = scan.next_n(4);
    arr.sort();
    if arr[0] + arr[3] == arr[1] + arr[2] || arr[0] + arr[1] + arr[2] == arr[3] {
        println!("YES");
    } else {
        println!("NO");
    }
}

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