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 ll(&mut self) -> i64 {
        self.cin()
    }
    fn ull(&mut self) -> u64 {
        self.cin()
    }
    fn vecu(&mut self, n: usize) -> Vec<usize> {
        self.vec(n)
    }
    fn vecll(&mut self, n: usize) -> Vec<i64> {
        self.vec(n)
    }
}

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

//
// ModInt
//

const M: i64 = 998244353;
#[derive(Debug, PartialEq, Eq, Clone, Copy, Default)]
struct ModInt {
    val: i64,
}
#[allow(dead_code)]
const M0: ModInt = ModInt { val: 0 };
const M1: ModInt = ModInt { val: 1 };
//const M_ERROR: ModInt = ModInt { val: -1 };

impl ModInt {
    fn new(v: i64) -> ModInt {
        ModInt {
            val: ModInt::val_from_i64(v),
        }
    }
    #[allow(dead_code)]
    fn new_raw(v: i64) -> ModInt {
        ModInt { val: v }
    }
    fn val_from_i64(v: i64) -> i64 {
        let t = v % M;
        if t < 0 {
            t + M
        } else {
            t
        }
    }
    fn val_from_addval(t: i64) -> i64 {
        if t >= M {
            t - M
        } else {
            t
        }
    }

    fn pow(self, exp: i64) -> ModInt {
        if exp == 0 {
            M1
        } else {
            let x = self.pow(exp / 2);
            if exp % 2 == 0 {
                x * x
            } else {
                self * x * x
            }
        }
    }

    fn inv(self) -> ModInt {
        self.pow(M - 2)
    }
}

impl std::ops::Add for ModInt {
    type Output = ModInt;
    fn add(self, rhs: ModInt) -> ModInt {
        ModInt {
            val: ModInt::val_from_addval(self.val + rhs.val),
        }
    }
}
impl std::ops::Add<i64> for ModInt {
    type Output = ModInt;
    fn add(self, rhs: i64) -> ModInt {
        ModInt {
            val: ModInt::val_from_i64(self.val + rhs),
        }
    }
}
impl std::ops::AddAssign for ModInt {
    fn add_assign(&mut self, other: ModInt) {
        self.val = ModInt::val_from_addval(self.val + other.val);
    }
}
impl std::ops::AddAssign<i64> for ModInt {
    fn add_assign(&mut self, other: i64) {
        self.val = ModInt::val_from_i64(self.val + other);
    }
}

impl std::ops::Sub for ModInt {
    type Output = ModInt;
    fn sub(self, rhs: ModInt) -> ModInt {
        ModInt {
            val: ModInt::val_from_addval(self.val - rhs.val + M),
        }
    }
}
impl std::ops::Sub<i64> for ModInt {
    type Output = ModInt;
    fn sub(self, rhs: i64) -> ModInt {
        self - ModInt::new(rhs)
    }
}
impl std::ops::SubAssign for ModInt {
    fn sub_assign(&mut self, other: ModInt) {
        self.val = ModInt::val_from_addval(self.val - other.val + M);
    }
}
impl std::ops::SubAssign<i64> for ModInt {
    fn sub_assign(&mut self, other: i64) {
        self.val = ModInt::val_from_i64(self.val - other);
    }
}

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

impl std::ops::Mul for ModInt {
    type Output = ModInt;
    fn mul(self, rhs: ModInt) -> ModInt {
        ModInt {
            val: self.val * rhs.val % M,
        }
    }
}
impl std::ops::Mul<i64> for ModInt {
    type Output = ModInt;
    fn mul(self, rhs: i64) -> ModInt {
        self * ModInt::new(rhs)
    }
}
impl std::ops::MulAssign for ModInt {
    fn mul_assign(&mut self, other: ModInt) {
        self.val = self.val * other.val % M;
    }
}
impl std::ops::MulAssign<i64> for ModInt {
    fn mul_assign(&mut self, other: i64) {
        self.mul_assign(ModInt::new(other));
    }
}

impl std::ops::Div for ModInt {
    type Output = ModInt;
    fn div(self, rhs: ModInt) -> ModInt {
        self * rhs.inv()
    }
}
impl std::ops::Div<i64> for ModInt {
    type Output = ModInt;
    fn div(self, rhs: i64) -> ModInt {
        self / ModInt::new(rhs)
    }
}

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

impl Solver {
    fn solve(&mut self, scan: &mut Scanner, out: &mut BufWriter<Stdout>) {
        // 1452d
        let n = scan.u();
        let mut dp = vec![M0;n+2]; // dp[i] : 都市i までが制約を満たす
        let mut dpsum = vec![M0;n+2]; // = dp[i] + dp[i-2] + dp[i-4] + ...

        dp[0] = M1;
        dpsum[0] = dp[0];

        let mut div = M1;
        for i in 1..=n {
            // dp[i] = dp[i-1] + dp[i-3] + dp[i-5] + ...
            dp[i] = dp[i-1] + if i >= 3 {dpsum[i-3]} else {M0};
            dpsum[i] = dp[i] + if i >= 2 { dpsum[i-2] } else {M0};
            div *= 2;
        }
        //writeln!(out, "{} {} ", dp[n] , div).ok();

        writeln!(out, "{}", dp[n] / div).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()
}


#![allow(dead_code, unused_imports, unused_macros)]

use std::fmt::Debug;
use std::str::FromStr;

fn read_stdin() -> String {
    let mut s = String::new();
    std::io::stdin()
        .read_line(&mut s)
        .expect("cannot read stdin");
    s.trim().to_string()
}

fn read<T>() -> T
where
    T: FromStr,
    <T as FromStr>::Err: Debug,
{
    read_stdin().parse::<T>().unwrap()
}

fn read_usize() -> usize {
    read::<usize>()
}

fn read_2<A, B>() -> (A, B)
where
    A: FromStr,
    <A as FromStr>::Err: Debug,
    B: FromStr,
    <B as FromStr>::Err: Debug,
{
    let s = read_stdin();
    let mut s = s.split_whitespace();
    let a = s.next().unwrap().parse::<A>().unwrap();
    let b = s.next().unwrap().parse::<B>().unwrap();
    (a, b)
}

fn read_3<A, B, C>() -> (A, B, C)
where
    A: FromStr,
    <A as FromStr>::Err: Debug,
    B: FromStr,
    <B as FromStr>::Err: Debug,
    C: FromStr,
    <C as FromStr>::Err: Debug,
{
    let s = read_stdin();
    let mut s = s.split_whitespace();
    let a = s.next().unwrap().parse::<A>().unwrap();
    let b = s.next().unwrap().parse::<B>().unwrap();
    let c = s.next().unwrap().parse::<C>().unwrap();
    (a, b, c)
}

fn read_4<A, B, C, D>() -> (A, B, C, D)
where
    A: FromStr,
    <A as FromStr>::Err: Debug,
    B: FromStr,
    <B as FromStr>::Err: Debug,
    C: FromStr,
    <C as FromStr>::Err: Debug,
    D: FromStr,
    <D as FromStr>::Err: Debug,
{
    let s = read_stdin();
    let mut s = s.split_whitespace();
    let a = s.next().unwrap().parse::<A>().unwrap();
    let b = s.next().unwrap().parse::<B>().unwrap();
    let c = s.next().unwrap().parse::<C>().unwrap();
    let d = s.next().unwrap().parse::<D>().unwrap();
    (a, b, c, d)
}

fn read_multiple<T: FromStr>() -> Vec<T>
where
    <T as FromStr>::Err: Debug,
{
    read_stdin()
        .split_whitespace()
        .map(|x| x.parse::<T>().expect("cannot parse stdin"))
        .collect()
}

/// NOTE: sort iter beforehand if required
fn count<T>(iter: &mut impl Iterator<Item = T>) -> Vec<(T, usize)>
where
    T: std::cmp::Ord,
{
    let iter = iter.collect::<Vec<_>>();
    //iter.sort();
    let (mut v, o, c) =
        iter.into_iter()
            .fold((Vec::new(), None, 0), |(mut v, last, count), item| {
                if let Some(o) = last {
                    if item == o {
                        (v, Some(o), count + 1)
                    } else {
                        v.push((o, count));
                        (v, Some(item), 1)
                    }
                } else {
                    (v, Some(item), 1)
                }
            });
    if let Some(i) = o {
        v.push((i, c));
    }
    v
}

fn partial_sum<T>(v: impl Iterator<Item = T>) -> impl Iterator<Item = T>
where
    T: Default + std::ops::Add<Output = T> + Copy,
{
    v.scan(T::default(), |state, x| {
        *state = *state + x;
        Some(*state)
    })
}

fn partial_max<T>(v: impl Iterator<Item = T>) -> impl Iterator<Item = T>
where
    T: Default + Ord + Copy,
{
    v.scan(T::default(), |state, x| {
        *state = max(*state, x);
        Some(*state)
    })
}

fn partial_min(v: impl Iterator<Item = u64>) -> impl Iterator<Item = u64> {
    v.scan(std::u64::MAX, |state, x| {
        *state = min(*state, x);
        Some(*state)
    })
}

fn max_subarray(v: impl Iterator<Item = i64>) -> (i64, (usize, usize)) {
    //assert!(v.len() > 0);
    let mut best_sum = 0;
    let (mut best_start, mut best_end) = (0, 0);
    let mut current_sum = 0;
    let mut current_start = 0;
    for (end, val) in v.enumerate() {
        if current_sum <= 0 {
            current_start = end;
            current_sum = val;
        } else {
            current_sum += val;
        }
        if current_sum > best_sum {
            best_sum = current_sum;
            best_start = current_start;
            best_end = end + 1;
        }
    }
    (best_sum, (best_start, best_end))
}

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

/// returns gcd, and pair (x, y), such that x * a + b * y == gcd
fn egcd(a: i64, b: i64) -> (i64, i64, i64) {
    if a == 0 {
        (b, 0, 1)
    } else {
        let (g, x, y) = egcd(b % a, a);
        (g, y - (b / a) * x, x)
    }
}

fn factorize(mut n: u64) -> Vec<u64> {
    if n <= 3 {
        return vec![n];
    }
    let mut v = Vec::new();
    while n % 2 == 0 {
        n /= 2;
        v.push(2);
    }
    while n % 3 == 0 {
        n /= 3;
        v.push(3);
    }
    let mut f = 6;
    while (f - 1) * (f - 1) <= n {
        while n % (f - 1) == 0 {
            n /= f - 1;
            v.push(f - 1);
        }
        while n % (f + 1) == 0 {
            n /= f + 1;
            v.push(f + 1);
        }
        f += 6;
    }
    if n > 1 {
        v.push(n);
    }
    v
}

fn compact_factors(n: u64) -> Vec<(u64, usize)> {
    count(&mut factorize(n).into_iter())
}

fn all_factors(n: u64) -> Vec<u64> {
    if n == 0 {
        return vec![0];
    } else if n == 1 {
        return vec![1];
    }
    let factors = compact_factors(n);
    let mut v = vec![1];
    for (fac, num) in factors {
        let ori = v.clone();
        for i in 1..num + 1 {
            v.append(
                &mut ori
                    .clone()
                    .into_iter()
                    .map(|f| f * fac.pow(i as u32))
                    .collect::<Vec<_>>(),
            )
        }
    }
    v.sort();
    v
}

fn abs_diff<T>(a: T, b: T) -> T
where
    T: PartialOrd + std::ops::Sub<Output = T>,
{
    if a > b {
        a - b
    } else {
        b - a
    }
}

struct Permutations<T> {
    inner: Vec<T>,
    state: Vec<usize>,
    i: usize,
    start: bool,
}

impl<T> Permutations<T> {
    fn new(inner: Vec<T>) -> Self {
        Self {
            state: vec![0; inner.len()],
            i: 0,
            start: true,
            inner,
        }
    }
}

/*impl<T, X> From<X> for Permutations<T>
where
    X: IntoIterator<Item = T>,
{
    fn from(f: X) -> Self {
        Self::new(f.into_iter().collect::<Vec<T>>())
    }
}*/

impl<T> Iterator for Permutations<T>
where
    T: Clone,
{
    type Item = Vec<T>;
    fn next(&mut self) -> Option<Self::Item> {
        if self.start {
            self.start = false;
            return Some(self.inner.clone());
        }
        while self.i < self.inner.len() {
            if self.state[self.i] < self.i {
                if self.i % 2 == 0 {
                    self.inner.swap(0, self.i)
                } else {
                    self.inner.swap(self.state[self.i], self.i)
                }
                self.state[self.i] += 1;
                self.i = 0;
                return Some(self.inner.clone());
            } else {
                self.state[self.i] = 0;
                self.i += 1;
            }
        }
        None
    }
}

use std::cmp::{max, min, Ord, Ordering};
use std::collections::{BinaryHeap, VecDeque};
use std::mem::swap;

macro_rules! max_with {
    ($x: expr, $y: expr) => {
        $x = max($x, $y)
    };
}

macro_rules! min_with {
    ($x: expr, $y: expr) => {
        $x = max($x, $y)
    };
}

fn is_prime(n: u64) -> bool {
    factorize(n).len() == 1
}

fn combination(n: u64, k: u64, m: u64) -> u64 {
    if n == 0 {
        return 1;
    }
    if k == 0 || k == n {
        return 1;
    }
    let new_k = if n - k < k { n - k } else { k };
    let mut res = 1;
    for i in ((n - new_k) + 1)..=n {
        res *= i;
        res %= m;
    }
    let mut den = 1;
    for i in 1..=(new_k) {
        den *= i;
        den %= m;
    }
    let (_one, inverse, _c) = egcd(den as i64, m as i64);
    let inverse = if inverse < 0 {
        m as i64 + inverse
    } else {
        inverse
    } as u64;
    //println!("inv: {} {}", den, inverse);
    res *= inverse;
    res %= m;
    res
}

use std::collections::HashSet;
use std::iter::FromIterator;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let modulo = 998244353;
    let n = read_usize();
    let mut num = 1;
    let mut denom = 4;
    let mut a = 1;
    let mut b = 1;
    for _ in 3..=n {
        let tmp = a + b;
        a = b;
        b = tmp % modulo;
        num = b;
        denom *= 2;
        denom %= modulo;
    }
    if n == 1 {
        denom = 2;
    }
    let (_g, mut denom_inv, _y) = egcd(denom, modulo);
    if denom_inv < 0 {
        denom_inv += modulo;
    }
    println!("{}", (num * denom_inv) % modulo);

    Ok(())
}


// codesnip-guard: minmax
#[macro_export]
macro_rules ! min { ($ e : expr) => { $ e } ; ($ e : expr , $ ($ es : expr) ,+) => { std :: cmp :: min ($ e , min ! ($ ($ es) ,+)) } ; }
#[macro_export]
macro_rules ! chmin { ($ dst : expr , $ ($ src : expr) ,+) => { { let x = std :: cmp :: min ($ dst , min ! ($ ($ src) ,+)) ; $ dst = x ; } } ; }
#[macro_export]
macro_rules ! max { ($ e : expr) => { $ e } ; ($ e : expr , $ ($ es : expr) ,+) => { std :: cmp :: max ($ e , max ! ($ ($ es) ,+)) } ; }
#[macro_export]
macro_rules ! chmax { ($ dst : expr , $ ($ src : expr) ,+) => { { let x = std :: cmp :: max ($ dst , max ! ($ ($ src) ,+)) ; $ dst = x ; } } ; }
// codesnip-guard: scanner
pub trait IterScan: Sized {
    type Output;
    fn scan<'a, I: Iterator<Item = &'a str>>(iter: &mut I) -> Option<Self::Output>;
}
pub trait MarkedIterScan: Sized {
    type Output;
    fn mscan<'a, I: Iterator<Item = &'a str>>(self, iter: &mut I) -> Option<Self::Output>;
}
#[derive(Clone, Debug)]
pub struct Scanner<'a> {
    iter: std::str::SplitAsciiWhitespace<'a>,
}
mod scanner_impls {
    use super::*;
    impl<'a> Scanner<'a> {
        #[inline]
        pub fn new(s: &'a str) -> Self {
            let iter = s.split_ascii_whitespace();
            Self { iter }
        }
        #[inline]
        pub fn scan<T: IterScan>(&mut self) -> <T as IterScan>::Output {
            <T as IterScan>::scan(&mut self.iter).expect("scan error")
        }
        #[inline]
        pub fn mscan<T: MarkedIterScan>(&mut self, marker: T) -> <T as MarkedIterScan>::Output {
            marker.mscan(&mut self.iter).expect("scan error")
        }
        #[inline]
        pub fn scan_vec<T: IterScan>(&mut self, size: usize) -> Vec<<T as IterScan>::Output> {
            (0..size)
                .map(|_| <T as IterScan>::scan(&mut self.iter).expect("scan error"))
                .collect()
        }
        #[inline]
        pub fn iter<'b, T: IterScan>(&'b mut self) -> ScannerIter<'a, 'b, T> {
            ScannerIter {
                inner: self,
                _marker: std::marker::PhantomData,
            }
        }
    }
    macro_rules ! iter_scan_impls { ($ ($ t : ty) *) => { $ (impl IterScan for $ t { type Output = Self ; # [inline] fn scan <'a , I : Iterator < Item = &'a str >> (iter : & mut I) -> Option < Self > { iter . next () ?. parse ::<$ t > () . ok () } }) * } ; }
    iter_scan_impls ! (char u8 u16 u32 u64 usize i8 i16 i32 i64 isize f32 f64 u128 i128 String);
    macro_rules ! iter_scan_tuple_impl { ($ ($ T : ident) *) => { impl <$ ($ T : IterScan) ,*> IterScan for ($ ($ T ,) *) { type Output = ($ (<$ T as IterScan >:: Output ,) *) ; # [inline] fn scan <'a , It : Iterator < Item = &'a str >> (_iter : & mut It) -> Option < Self :: Output > { Some (($ (<$ T as IterScan >:: scan (_iter) ?,) *)) } } } ; }
    iter_scan_tuple_impl!();
    iter_scan_tuple_impl!(A);
    iter_scan_tuple_impl ! (A B);
    iter_scan_tuple_impl ! (A B C);
    iter_scan_tuple_impl ! (A B C D);
    iter_scan_tuple_impl ! (A B C D E);
    iter_scan_tuple_impl ! (A B C D E F);
    iter_scan_tuple_impl ! (A B C D E F G);
    iter_scan_tuple_impl ! (A B C D E F G H);
    iter_scan_tuple_impl ! (A B C D E F G H I);
    iter_scan_tuple_impl ! (A B C D E F G H I J);
    iter_scan_tuple_impl ! (A B C D E F G H I J K);
    pub struct ScannerIter<'a, 'b, T> {
        inner: &'b mut Scanner<'a>,
        _marker: std::marker::PhantomData<fn() -> T>,
    }
    impl<'a, 'b, T: IterScan> Iterator for ScannerIter<'a, 'b, T> {
        type Item = <T as IterScan>::Output;
        #[inline]
        fn next(&mut self) -> Option<Self::Item> {
            <T as IterScan>::scan(&mut self.inner.iter)
        }
    }
}
pub mod marker {
    use super::*;
    use std::{iter::FromIterator, marker::PhantomData};
    #[derive(Debug, Copy, Clone)]
    pub struct Usize1;
    impl IterScan for Usize1 {
        type Output = usize;
        #[inline]
        fn scan<'a, I: Iterator<Item = &'a str>>(iter: &mut I) -> Option<Self::Output> {
            Some(<usize as IterScan>::scan(iter)?.checked_sub(1)?)
        }
    }
    #[derive(Debug, Copy, Clone)]
    pub struct Chars;
    impl IterScan for Chars {
        type Output = Vec<char>;
        #[inline]
        fn scan<'a, I: Iterator<Item = &'a str>>(iter: &mut I) -> Option<Self::Output> {
            Some(iter.next()?.chars().collect())
        }
    }
    #[derive(Debug, Copy, Clone)]
    pub struct CharsWithBase(pub char);
    impl MarkedIterScan for CharsWithBase {
        type Output = Vec<usize>;
        #[inline]
        fn mscan<'a, I: Iterator<Item = &'a str>>(self, iter: &mut I) -> Option<Self::Output> {
            Some(
                iter.next()?
                    .chars()
                    .map(|c| (c as u8 - self.0 as u8) as usize)
                    .collect(),
            )
        }
    }
    #[derive(Debug, Copy, Clone)]
    pub struct Collect<T: IterScan, B: FromIterator<<T as IterScan>::Output>> {
        size: usize,
        _marker: PhantomData<fn() -> (T, B)>,
    }
    impl<T: IterScan, B: FromIterator<<T as IterScan>::Output>> Collect<T, B> {
        pub fn new(size: usize) -> Self {
            Self {
                size,
                _marker: PhantomData,
            }
        }
    }
    impl<T: IterScan, B: FromIterator<<T as IterScan>::Output>> MarkedIterScan for Collect<T, B> {
        type Output = B;
        #[inline]
        fn mscan<'a, I: Iterator<Item = &'a str>>(self, iter: &mut I) -> Option<Self::Output> {
            Some(
                (0..self.size)
                    .map(|_| <T as IterScan>::scan(iter).expect("scan error"))
                    .collect::<B>(),
            )
        }
    }
}
// codesnip-guard: zero_one
pub trait Zero: PartialEq + Sized {
    fn zero() -> Self;
    #[inline]
    fn is_zero(&self) -> bool {
        self == &Self::zero()
    }
}
pub trait One: PartialEq + Sized {
    fn one() -> Self;
    #[inline]
    fn is_one(&self) -> bool {
        self == &Self::one()
    }
}
macro_rules ! zero_one_impls { ($ ({ $ Trait : ident $ method : ident $ ($ t : ty) *, $ e : expr }) *) => { $ ($ (impl $ Trait for $ t { # [inline] fn $ method () -> Self { $ e } }) *) * } ; }
zero_one_impls ! ({ Zero zero u8 u16 u32 u64 usize i8 i16 i32 i64 isize u128 i128 , 0 } { Zero zero f32 f64 , 0. } { One one u8 u16 u32 u64 usize i8 i16 i32 i64 isize u128 i128 , 1 } { One one f32 f64 , 1. });
// codesnip-guard: main
fn main() {
    #![allow(unused_imports, unused_macros)]
    use std::io::{stdin, stdout, BufWriter, Read as _, Write as _};
    let mut _in_buf = Vec::new();
    stdin().read_to_end(&mut _in_buf).expect("io error");
    let _in_buf = unsafe { String::from_utf8_unchecked(_in_buf) };
    let mut scanner = Scanner::new(&_in_buf);
    macro_rules ! scan { () => { scan ! (usize) } ; (($ ($ t : tt) ,*)) => { ($ (scan ! ($ t)) ,*) } ; ([$ t : tt ; $ len : expr]) => { (0 ..$ len) . map (| _ | scan ! ($ t)) . collect ::< Vec < _ >> () } ; ([$ t : ty ; $ len : expr]) => { scanner . scan_vec ::<$ t > ($ len) } ; ([$ t : ty]) => { scanner . iter ::<$ t > () } ; ({ $ e : expr }) => { scanner . mscan ($ e) } ; ($ t : ty) => { scanner . scan ::<$ t > () } ; }
    let _out = stdout();
    let mut _out = BufWriter::new(_out.lock());
    macro_rules ! print { ($ ($ arg : tt) *) => (:: std :: write ! (_out , $ ($ arg) *) . expect ("io error")) }
    macro_rules ! println { ($ ($ arg : tt) *) => (:: std :: writeln ! (_out , $ ($ arg) *) . expect ("io error")) }
    macro_rules! echo {
        ($ iter : expr) => {
            echo!($iter, '\n')
        };
        ($ iter : expr , $ sep : expr) => {
            let mut iter = $iter.into_iter();
            if let Some(item) = iter.next() {
                print!("{}", item);
            }
            for item in iter {
                print!("{}{}", $sep, item);
            }
            println!();
        };
    }
    let n = scan!();
    let mut dp = vec![M::zero(); n + 1];
    let mut acc1 = vec![M::zero(); n + 1];
    let mut acc2 = vec![M::zero(); n + 1];
    dp[0] = M::one();
    acc1[0] = M::one();
    for i in 0..n {
        dp[i + 1] = if i % 2 == 0 { acc1[i] } else { acc2[i] };
        acc1[i + 1] = acc1[i];
        acc2[i + 1] = acc2[i];
        if i % 2 == 0 {
            acc2[i + 1] += dp[i + 1];
        } else {
            acc1[i + 1] += dp[i + 1];
        }
    }
    println!("{}", dp[n] / M::new(2).pow(n));
}
type M = montgomery::MInt998244353;
// codesnip-guard: MIntBase
#[repr(transparent)]
pub struct MInt<M>
where
    M: MIntBase,
{
    x: M::Inner,
    _marker: std::marker::PhantomData<fn() -> M>,
}
pub trait MIntBase {
    type Inner: Sized + Copy + Eq + std::fmt::Debug + std::hash::Hash;
    fn get_mod() -> Self::Inner;
    fn mod_zero() -> Self::Inner;
    fn mod_one() -> Self::Inner;
    fn mod_add(x: Self::Inner, y: Self::Inner) -> Self::Inner;
    fn mod_sub(x: Self::Inner, y: Self::Inner) -> Self::Inner;
    fn mod_mul(x: Self::Inner, y: Self::Inner) -> Self::Inner;
    fn mod_div(x: Self::Inner, y: Self::Inner) -> Self::Inner;
    fn mod_neg(x: Self::Inner) -> Self::Inner;
    fn mod_inv(x: Self::Inner) -> Self::Inner;
    fn mod_pow(x: Self::Inner, y: usize) -> Self::Inner {
        let (mut x, mut y, mut z) = (x, y, Self::mod_one());
        while y > 0 {
            if y & 1 == 1 {
                z = Self::mod_mul(z, x);
            }
            x = Self::mod_mul(x, x);
            y >>= 1;
        }
        z
    }
}
pub trait MIntConvert<T = <Self as MIntBase>::Inner>: MIntBase {
    fn from(x: T) -> <Self as MIntBase>::Inner;
    fn into(x: <Self as MIntBase>::Inner) -> T;
    fn mod_into() -> T;
}
mod mint_base {
    use super::*;
    use std::{
        fmt::{self, Debug, Display},
        hash::{Hash, Hasher},
        iter::{Product, Sum},
        marker::PhantomData,
        ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign},
        str::FromStr,
    };
    impl<M> MInt<M>
    where
        M: MIntConvert,
    {
        #[inline]
        pub fn new(x: M::Inner) -> Self {
            Self::new_unchecked(<M as MIntConvert<M::Inner>>::from(x))
        }
        #[inline]
        pub fn inner(self) -> M::Inner {
            <M as MIntConvert<M::Inner>>::into(self.x)
        }
    }
    impl<M> MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        pub fn new_unchecked(x: M::Inner) -> Self {
            Self {
                x,
                _marker: PhantomData,
            }
        }
        #[inline]
        pub fn get_mod() -> M::Inner {
            M::get_mod()
        }
        #[inline]
        pub fn pow(self, y: usize) -> Self {
            Self::new_unchecked(M::mod_pow(self.x, y))
        }
        #[inline]
        pub fn inv(self) -> Self {
            Self::new_unchecked(M::mod_inv(self.x))
        }
    }
    impl<M> Clone for MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        fn clone(&self) -> Self {
            Self {
                x: Clone::clone(&self.x),
                _marker: PhantomData,
            }
        }
    }
    impl<M> Copy for MInt<M> where M: MIntBase {}
    impl<M> Debug for MInt<M>
    where
        M: MIntBase,
    {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            Debug::fmt(&self.x, f)
        }
    }
    impl<M> Default for MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        fn default() -> Self {
            <Self as Zero>::zero()
        }
    }
    impl<M> PartialEq for MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        fn eq(&self, other: &Self) -> bool {
            PartialEq::eq(&self.x, &other.x)
        }
    }
    impl<M> Eq for MInt<M> where M: MIntBase {}
    impl<M> Hash for MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        fn hash<H: Hasher>(&self, state: &mut H) {
            Hash::hash(&self.x, state)
        }
    }
    macro_rules ! impl_mint_from { ($ ($ t : ty) ,*) => { $ (impl < M > From <$ t > for MInt < M > where M : MIntConvert <$ t >, { # [inline] fn from (x : $ t) -> Self { Self :: new_unchecked (< M as MIntConvert <$ t >>:: from (x)) } } impl < M > From < MInt < M >> for $ t where M : MIntConvert <$ t >, { # [inline] fn from (x : MInt < M >) -> $ t { < M as MIntConvert <$ t >>:: into (x . x) } }) * } ; }
    impl_mint_from!(u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize);
    impl<M> Zero for MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        fn zero() -> Self {
            Self::new_unchecked(M::mod_zero())
        }
    }
    impl<M> One for MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        fn one() -> Self {
            Self::new_unchecked(M::mod_one())
        }
    }
    impl<M> Add for MInt<M>
    where
        M: MIntBase,
    {
        type Output = Self;
        #[inline]
        fn add(self, rhs: Self) -> Self::Output {
            Self::new_unchecked(M::mod_add(self.x, rhs.x))
        }
    }
    impl<M> Sub for MInt<M>
    where
        M: MIntBase,
    {
        type Output = Self;
        #[inline]
        fn sub(self, rhs: Self) -> Self::Output {
            Self::new_unchecked(M::mod_sub(self.x, rhs.x))
        }
    }
    impl<M> Mul for MInt<M>
    where
        M: MIntBase,
    {
        type Output = Self;
        #[inline]
        fn mul(self, rhs: Self) -> Self::Output {
            Self::new_unchecked(M::mod_mul(self.x, rhs.x))
        }
    }
    impl<M> Div for MInt<M>
    where
        M: MIntBase,
    {
        type Output = Self;
        #[inline]
        fn div(self, rhs: Self) -> Self::Output {
            Self::new_unchecked(M::mod_div(self.x, rhs.x))
        }
    }
    impl<M> Neg for MInt<M>
    where
        M: MIntBase,
    {
        type Output = Self;
        #[inline]
        fn neg(self) -> Self::Output {
            Self::new_unchecked(M::mod_neg(self.x))
        }
    }
    impl<M> Sum for MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
            iter.fold(<Self as Zero>::zero(), Add::add)
        }
    }
    impl<M> Product for MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        fn product<I: Iterator<Item = Self>>(iter: I) -> Self {
            iter.fold(<Self as One>::one(), Mul::mul)
        }
    }
    impl<'a, M: 'a> Sum<&'a MInt<M>> for MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        fn sum<I: Iterator<Item = &'a Self>>(iter: I) -> Self {
            iter.fold(<Self as Zero>::zero(), Add::add)
        }
    }
    impl<'a, M: 'a> Product<&'a MInt<M>> for MInt<M>
    where
        M: MIntBase,
    {
        #[inline]
        fn product<I: Iterator<Item = &'a Self>>(iter: I) -> Self {
            iter.fold(<Self as One>::one(), Mul::mul)
        }
    }
    impl<M> Display for MInt<M>
    where
        M: MIntConvert,
        M::Inner: Display,
    {
        fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> Result<(), fmt::Error> {
            write!(f, "{}", self.inner())
        }
    }
    impl<M> FromStr for MInt<M>
    where
        M: MIntConvert,
        M::Inner: FromStr,
    {
        type Err = <M::Inner as FromStr>::Err;
        #[inline]
        fn from_str(s: &str) -> Result<Self, Self::Err> {
            s.parse::<M::Inner>().map(Self::new)
        }
    }
    impl<M> IterScan for MInt<M>
    where
        M: MIntConvert,
        M::Inner: FromStr,
    {
        type Output = Self;
        #[inline]
        fn scan<'a, I: Iterator<Item = &'a str>>(iter: &mut I) -> Option<Self::Output> {
            iter.next()?.parse::<MInt<M>>().ok()
        }
    }
    macro_rules! impl_mint_ref_binop {
        ($ imp : ident , $ method : ident , $ t : ty) => {
            impl<M> $imp<$t> for &$t
            where
                M: MIntBase,
            {
                type Output = <$t as $imp<$t>>::Output;
                #[inline]
                fn $method(self, other: $t) -> <$t as $imp<$t>>::Output {
                    $imp::$method(*self, other)
                }
            }
            impl<M> $imp<&$t> for $t
            where
                M: MIntBase,
            {
                type Output = <$t as $imp<$t>>::Output;
                #[inline]
                fn $method(self, other: &$t) -> <$t as $imp<$t>>::Output {
                    $imp::$method(self, *other)
                }
            }
            impl<M> $imp<&$t> for &$t
            where
                M: MIntBase,
            {
                type Output = <$t as $imp<$t>>::Output;
                #[inline]
                fn $method(self, other: &$t) -> <$t as $imp<$t>>::Output {
                    $imp::$method(*self, *other)
                }
            }
        };
    }
    impl_mint_ref_binop!(Add, add, MInt<M>);
    impl_mint_ref_binop!(Sub, sub, MInt<M>);
    impl_mint_ref_binop!(Mul, mul, MInt<M>);
    impl_mint_ref_binop!(Div, div, MInt<M>);
    macro_rules! impl_mint_ref_unop {
        ($ imp : ident , $ method : ident , $ t : ty) => {
            impl<M> $imp for &$t
            where
                M: MIntBase,
            {
                type Output = <$t as $imp>::Output;
                #[inline]
                fn $method(self) -> <$t as $imp>::Output {
                    $imp::$method(*self)
                }
            }
        };
    }
    impl_mint_ref_unop!(Neg, neg, MInt<M>);
    macro_rules! impl_mint_ref_op_assign {
        ($ imp : ident , $ method : ident , $ t : ty , $ fromimp : ident , $ frommethod : ident) => {
            impl<M> $imp<$t> for $t
            where
                M: MIntBase,
            {
                #[inline]
                fn $method(&mut self, rhs: $t) {
                    *self = $fromimp::$frommethod(*self, rhs);
                }
            }
            impl<M> $imp<&$t> for $t
            where
                M: MIntBase,
            {
                #[inline]
                fn $method(&mut self, other: &$t) {
                    $imp::$method(self, *other);
                }
            }
        };
    }
    impl_mint_ref_op_assign!(AddAssign, add_assign, MInt<M>, Add, add);
    impl_mint_ref_op_assign!(SubAssign, sub_assign, MInt<M>, Sub, sub);
    impl_mint_ref_op_assign!(MulAssign, mul_assign, MInt<M>, Mul, mul);
    impl_mint_ref_op_assign!(DivAssign, div_assign, MInt<M>, Div, div);
}
// codesnip-guard: MInt
pub mod mint_basic {
    use super::*;
    #[macro_export]
    macro_rules ! define_basic_mintbase { ($ name : ident , $ m : expr , $ basety : ty , $ upperty : ty , [$ ($ unsigned : ty) ,*] , [$ ($ signed : ty) ,*]) => { pub struct $ name ; impl MIntBase for $ name { type Inner = $ basety ; # [inline] fn get_mod () -> Self :: Inner { $ m } # [inline] fn mod_zero () -> Self :: Inner { 0 } # [inline] fn mod_one () -> Self :: Inner { 1 } # [inline] fn mod_add (x : Self :: Inner , y : Self :: Inner) -> Self :: Inner { let z = x + y ; let m = Self :: get_mod () ; if z >= m { z - m } else { z } } # [inline] fn mod_sub (x : Self :: Inner , y : Self :: Inner) -> Self :: Inner { if x < y { x + Self :: get_mod () - y } else { x - y } } # [inline] fn mod_mul (x : Self :: Inner , y : Self :: Inner) -> Self :: Inner { (x as $ upperty * y as $ upperty % Self :: get_mod () as $ upperty) as $ basety } # [inline] fn mod_div (x : Self :: Inner , y : Self :: Inner) -> Self :: Inner { Self :: mod_mul (x , Self :: mod_inv (y)) } # [inline] fn mod_neg (x : Self :: Inner) -> Self :: Inner { if x == 0 { 0 } else { Self :: get_mod () - x } } fn mod_inv (x : Self :: Inner) -> Self :: Inner { let mut a = x ; let (mut b , mut u , mut s) = (Self :: get_mod () , 1 , 0) ; let k = a . trailing_zeros () ; a >>= k ; for _ in 0 .. k { if u & 1 == 1 { u += Self :: get_mod () ; } u /= 2 ; } while a != b { if b < a { std :: mem :: swap (& mut a , & mut b) ; std :: mem :: swap (& mut u , & mut s) ; } b -= a ; if s < u { s += Self :: get_mod () ; } s -= u ; let k = b . trailing_zeros () ; b >>= k ; for _ in 0 .. k { if s & 1 == 1 { s += Self :: get_mod () ; } s /= 2 ; } } s } } $ (impl MIntConvert <$ unsigned > for $ name { # [inline] fn from (x : $ unsigned) -> Self :: Inner { (x % < Self as MIntBase >:: get_mod () as $ unsigned) as $ basety } # [inline] fn into (x : Self :: Inner) -> $ unsigned { x as $ unsigned } # [inline] fn mod_into () -> $ unsigned { < Self as MIntBase >:: get_mod () as $ unsigned } }) * $ (impl MIntConvert <$ signed > for $ name { # [inline] fn from (x : $ signed) -> Self :: Inner { let x = x % < Self as MIntBase >:: get_mod () as $ signed ; if x < 0 { (x + < Self as MIntBase >:: get_mod () as $ signed) as $ basety } else { x as $ basety } } # [inline] fn into (x : Self :: Inner) -> $ signed { x as $ signed } # [inline] fn mod_into () -> $ signed { < Self as MIntBase >:: get_mod () as $ signed } }) * } ; }
    #[macro_export]
    macro_rules ! define_basic_mint32 { ($ ([$ name : ident , $ m : expr , $ mint_name : ident]) ,*) => { $ (crate :: define_basic_mintbase ! ($ name , $ m , u32 , u64 , [u32 , u64 , u128 , usize] , [i32 , i64 , i128 , isize]) ; pub type $ mint_name = MInt <$ name >;) * } ; }
    define_basic_mint32!(
        [Modulo998244353, 998_244_353, MInt998244353],
        [Modulo1000000007, 1_000_000_007, MInt1000000007],
        [Modulo1000000009, 1_000_000_009, MInt1000000009],
        [DynModuloU32, unsafe { DYN_MODULUS_U32 }, DynMIntU32]
    );
    static mut DYN_MODULUS_U32: u32 = 1_000_000_007;
    impl DynModuloU32 {
        pub fn set_mod(m: u32) {
            unsafe {
                DYN_MODULUS_U32 = m;
            }
        }
    }
    static mut DYN_MODULUS_U64: u64 = 1_000_000_007;
    define_basic_mintbase!(
        DynModuloU64,
        unsafe { DYN_MODULUS_U64 },
        u64,
        u128,
        [u64, u128, usize],
        [i64, i128, isize]
    );
    impl DynModuloU64 {
        pub fn set_mod(m: u64) {
            unsafe {
                DYN_MODULUS_U64 = m;
            }
        }
    }
    pub type DynMIntU64 = MInt<DynModuloU64>;
    pub struct Modulo2;
    impl MIntBase for Modulo2 {
        type Inner = u32;
        #[inline]
        fn get_mod() -> Self::Inner {
            2
        }
        #[inline]
        fn mod_zero() -> Self::Inner {
            0
        }
        #[inline]
        fn mod_one() -> Self::Inner {
            1
        }
        #[inline]
        fn mod_add(x: Self::Inner, y: Self::Inner) -> Self::Inner {
            x ^ y
        }
        #[inline]
        fn mod_sub(x: Self::Inner, y: Self::Inner) -> Self::Inner {
            x ^ y
        }
        #[inline]
        fn mod_mul(x: Self::Inner, y: Self::Inner) -> Self::Inner {
            x | y
        }
        #[inline]
        fn mod_div(x: Self::Inner, y: Self::Inner) -> Self::Inner {
            assert_ne!(y, 0);
            x
        }
        #[inline]
        fn mod_neg(x: Self::Inner) -> Self::Inner {
            x
        }
        #[inline]
        fn mod_inv(x: Self::Inner) -> Self::Inner {
            assert_ne!(x, 0);
            x
        }
        #[inline]
        fn mod_pow(x: Self::Inner, y: usize) -> Self::Inner {
            if y == 0 {
                1
            } else {
                x
            }
        }
    }
    macro_rules ! impl_to_mint_base_for_modulo2 { ($ name : ident , $ basety : ty , [$ ($ t : ty) ,*]) => { $ (impl MIntConvert <$ t > for $ name { # [inline] fn from (x : $ t) -> Self :: Inner { (x & 1) as $ basety } # [inline] fn into (x : Self :: Inner) -> $ t { x as $ t } # [inline] fn mod_into () -> $ t { 1 } }) * } ; }
    impl_to_mint_base_for_modulo2!(
        Modulo2,
        u32,
        [u8, u16, u32, u64, u128, usize, i8, i16, i32, i64, i128, isize]
    );
    pub type MInt2 = MInt<Modulo2>;
}
// codesnip-guard: montgomery
pub mod montgomery {
    use super::*;
    pub struct Modulo998244353;
    pub type MInt998244353 = MInt<Modulo998244353>;
    impl<M> MIntBase for M
    where
        M: MontgomeryReduction32,
    {
        type Inner = u32;
        #[inline]
        fn get_mod() -> Self::Inner {
            <Self as MontgomeryReduction32>::get_mod()
        }
        #[inline]
        fn mod_zero() -> Self::Inner {
            0
        }
        #[inline]
        fn mod_one() -> Self::Inner {
            Self::n1()
        }
        #[inline]
        fn mod_add(x: Self::Inner, y: Self::Inner) -> Self::Inner {
            let z = x + y;
            let m = Self::get_mod();
            if z >= m {
                z - m
            } else {
                z
            }
        }
        #[inline]
        fn mod_sub(x: Self::Inner, y: Self::Inner) -> Self::Inner {
            if x < y {
                x + Self::get_mod() - y
            } else {
                x - y
            }
        }
        #[inline]
        fn mod_mul(x: Self::Inner, y: Self::Inner) -> Self::Inner {
            Self::reduce(x as u64 * y as u64)
        }
        #[inline]
        fn mod_div(x: Self::Inner, y: Self::Inner) -> Self::Inner {
            Self::mod_mul(x, Self::mod_inv(y))
        }
        #[inline]
        fn mod_neg(x: Self::Inner) -> Self::Inner {
            if x == 0 {
                0
            } else {
                Self::get_mod() - x
            }
        }
        fn mod_inv(x: Self::Inner) -> Self::Inner {
            let mut a = x;
            let m = Self::get_mod();
            let (mut b, mut u, mut s) = (m, 1, 0);
            let k = a.trailing_zeros();
            a >>= k;
            for _ in 0..k {
                if u & 1 == 1 {
                    u += m;
                }
                u /= 2;
            }
            while a != b {
                if b < a {
                    std::mem::swap(&mut a, &mut b);
                    std::mem::swap(&mut u, &mut s);
                }
                b -= a;
                if s < u {
                    s += m;
                }
                s -= u;
                let k = b.trailing_zeros();
                b >>= k;
                for _ in 0..k {
                    if s & 1 == 1 {
                        s += m;
                    }
                    s /= 2;
                }
            }
            Self::reduce(s as u64 * Self::n3() as u64)
        }
    }
    impl<M> MIntConvert<u32> for M
    where
        M: MontgomeryReduction32,
    {
        #[inline]
        fn from(x: u32) -> Self::Inner {
            Self::reduce(x as u64 * Self::n2() as u64)
        }
        #[inline]
        fn into(x: Self::Inner) -> u32 {
            Self::reduce(x as u64) as u32
        }
        #[inline]
        fn mod_into() -> u32 {
            <Self as MIntBase>::get_mod() as u32
        }
    }
    impl<M> MIntConvert<u64> for M
    where
        M: MontgomeryReduction32,
    {
        #[inline]
        fn from(x: u64) -> Self::Inner {
            Self::reduce(x % Self::get_mod() as u64 * Self::n2() as u64)
        }
        #[inline]
        fn into(x: Self::Inner) -> u64 {
            Self::reduce(x as u64) as u64
        }
        #[inline]
        fn mod_into() -> u64 {
            <Self as MIntBase>::get_mod() as u64
        }
    }
    impl<M> MIntConvert<usize> for M
    where
        M: MontgomeryReduction32,
    {
        #[inline]
        fn from(x: usize) -> Self::Inner {
            Self::reduce(x as u64 % Self::get_mod() as u64 * Self::n2() as u64)
        }
        #[inline]
        fn into(x: Self::Inner) -> usize {
            Self::reduce(x as u64) as usize
        }
        #[inline]
        fn mod_into() -> usize {
            <Self as MIntBase>::get_mod() as usize
        }
    }
    impl MIntConvert<i32> for Modulo998244353 {
        #[inline]
        fn from(x: i32) -> Self::Inner {
            let x = x % <Self as MIntBase>::get_mod() as i32;
            let x = if x < 0 {
                (x + <Self as MIntBase>::get_mod() as i32) as u64
            } else {
                x as u64
            };
            Self::reduce(x as u64 * Self::n2() as u64)
        }
        #[inline]
        fn into(x: Self::Inner) -> i32 {
            Self::reduce(x as u64) as i32
        }
        #[inline]
        fn mod_into() -> i32 {
            <Self as MIntBase>::get_mod() as i32
        }
    }
    impl MIntConvert<i64> for Modulo998244353 {
        #[inline]
        fn from(x: i64) -> Self::Inner {
            let x = x % <Self as MIntBase>::get_mod() as i64;
            let x = if x < 0 {
                (x + <Self as MIntBase>::get_mod() as i64) as u64
            } else {
                x as u64
            };
            Self::reduce(x as u64 * Self::n2() as u64)
        }
        #[inline]
        fn into(x: Self::Inner) -> i64 {
            Self::reduce(x as u64) as i64
        }
        #[inline]
        fn mod_into() -> i64 {
            <Self as MIntBase>::get_mod() as i64
        }
    }
    impl MIntConvert<isize> for Modulo998244353 {
        #[inline]
        fn from(x: isize) -> Self::Inner {
            let x = x % <Self as MIntBase>::get_mod() as isize;
            let x = if x < 0 {
                (x + <Self as MIntBase>::get_mod() as isize) as u64
            } else {
                x as u64
            };
            Self::reduce(x as u64 * Self::n2() as u64)
        }
        #[inline]
        fn into(x: Self::Inner) -> isize {
            Self::reduce(x as u64) as isize
        }
        #[inline]
        fn mod_into() -> isize {
            <Self as MIntBase>::get_mod() as isize
        }
    }
    /// m is prime, n = 2^32
    pub trait MontgomeryReduction32 {
        /// m
        fn get_mod() -> u32;
        /// (-m)^{-1} mod n
        fn r() -> u32 {
            let m = Self::get_mod();
            let mut r = 0;
            let mut t = 0;
            for i in 0..32 {
                if t % 2 == 0 {
                    t += m;
                    r += 1 << i;
                }
                t /= 2;
            }
            r
        }
        /// n^1 mod m
        fn n1() -> u32;
        /// n^2 mod m
        fn n2() -> u32;
        /// n^3 mod m
        fn n3() -> u32;
        /// n^{-1}x = (x + (xr mod n)m) / n
        fn reduce(x: u64) -> u32 {
            let m: u32 = Self::get_mod();
            let r = Self::r();
            let mut x = ((x + r.wrapping_mul(x as u32) as u64 * m as u64) >> 32) as u32;
            if x >= m {
                x -= m;
            }
            x
        }
    }
    macro_rules! impl_montgomery_reduction_32 {
        ($ name : ident , $ m : expr , $ r : expr , $ n1 : expr , $ n2 : expr , $ n3 : expr) => {
            impl MontgomeryReduction32 for $name {
                #[inline]
                fn get_mod() -> u32 {
                    $m
                }
                #[inline]
                fn r() -> u32 {
                    $r
                }
                #[inline]
                fn n1() -> u32 {
                    $n1
                }
                #[inline]
                fn n2() -> u32 {
                    $n2
                }
                #[inline]
                fn n3() -> u32 {
                    $n3
                }
            }
        };
    }
    impl_montgomery_reduction_32!(
        Modulo998244353,
        998_244_353,
        998_244_351,
        301_989_884,
        932_051_910,
        679_058_953
    );
}


// ---------- begin input macro ----------
// reference: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
use std::collections::HashMap;

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, bytes) => {
        read_value!($iter, String).bytes().collect::<Vec<u8>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
// ---------- end input macro ----------
const MOD: u64 = 998244353;

struct Fibo {
    memo: HashMap<u64, u64>,
}

impl Fibo {
    fn new() -> Self {
        let mut memo = HashMap::new();
        memo.insert(0, 1);
        memo.insert(1, 1);
        Self { memo }
    }

    fn get(&mut self, index: u64) -> u64 {
        if let Some(value) = self.memo.get(&index) {
            return *value;
        } else {
            let a = index / 2;
            let b = index - a;
            let result = (self.get(a) * self.get(b) + self.get(a - 1) * self.get(b - 1)) % MOD;
            self.memo.insert(index, result);
            result
        }
    }
}

fn modpow(mut value: u64, mut exp: u64) -> u64 {
    let mut res = 1;

    while exp > 0 {
        if exp & 1 == 1 {
            res = value * res % MOD;
        }
        value = value * value % MOD;
        exp >>= 1;
    }

    res
}

fn run() {
    input! {
        n: u64,
    }

    let result = Fibo::new().get(n - 1) * modpow(modpow(2, n), MOD - 2) % MOD;
    println!("{:?}", result);
}

fn main() {
    run();
}


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 {
       if self.buffer.len() == 0 {
          let mut input = String::new();
          std::io::stdin().read_line(&mut input).ok();
          for word in input.split_whitespace() {
             self.buffer.push_back(word.to_string())
          }
       }
       let front = self.buffer.pop_front().unwrap();
       front.parse::<T>().ok().unwrap()
    }

}

fn main() {
    let mut scanner = Scanner::new();
    let n : usize = scanner.next();
    let mut r: Vec<i32> = Vec::new();
    let (mut r_win, mut b_win) = (0, 0);
    for _ in 0..n {
        let num : i32 = scanner.next();
        r.push(num);
    }
    for i in 0..n {
        let num : i32 = scanner.next();
        if num > r[i] {
            b_win += 1;
        } else if num < r[i] {
            r_win += 1;
        }
    }
    if r_win == 0 {
        println!("-1");
    } else {
        println!("{}", b_win / r_win + 1);
    }
}


use std::io;

fn main() {
    let (mut cnt1, mut cnt2);

    cnt1 = 0;
    cnt2 = 0;

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

    let n: usize = s.trim().parse().unwrap();

    s = String::new();
    io::stdin().read_line(&mut s).expect("Failed to read line");
    let a = s
        .split_whitespace()
        .map(|x| x.parse::<i32>())
        .collect::<Result<Vec<i32>, _>>()
        .unwrap();

    s = String::new();
    io::stdin().read_line(&mut s).expect("Failed to read line");
    let b = s
        .split_whitespace()
        .map(|x| x.parse::<i32>())
        .collect::<Result<Vec<i32>, _>>()
        .unwrap();

    for i in 0usize..n {
        if a[i] == 1 && b[i] == 0 {
            cnt1 = cnt1 + 1;
        } else if a[i] == 0 && b[i] == 1 {
            cnt2 = cnt2 + 1;
        }
    }

    if cnt1 == 0 {
        println!("-1");
    } else {
        println!("{}", cnt2 / cnt1 + 1);
    }
}


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

fn main() {
    let _n = get_input().trim().parse::<usize>().unwrap();
    let ra: Vec<usize> = get_input().trim().split(' ').map(|x| x.parse::<usize>().unwrap()).collect();
    let rb: Vec<usize> = get_input().trim().split(' ').map(|x| x.parse::<usize>().unwrap()).collect();
    let mut badv = 0;
    let mut rchn = 0;
    for (rv, bv) in ra.iter().zip(rb) {
        if *rv == 0 && bv == 1 {
            badv += 1;
        } else if *rv == 1 && bv == 0 {
            rchn += 1;
        }
    }

    if rchn == 0 {
        println!("{}", -1);
    } else if badv == 0 {
        println!("{}", 1);
    } else {
        let rwin = badv + 1;
        if rwin % rchn != 0 {
            println!("{}", 1 + (rwin / rchn));
        } else {
            println!("{}", rwin / rchn);
        }
    }
}


use std::io::stdin;

#[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 responses = scan.next::<usize>();
    let mut robo_coder_s = String::new();
    stdin().read_line(&mut robo_coder_s).expect("Failed read");
    let robo_coder = robo_coder_s.split_whitespace().collect::<Vec<&str>>();
    let mut bionic_solver_s = String::new();
    stdin()
        .read_line(&mut bionic_solver_s)
        .expect("Failed read");
    let bionic_solver = bionic_solver_s.split_whitespace().collect::<Vec<&str>>();

    let mut only_robo_coder_wins = 0.0;
    let mut only_bionic_solver_wins = 0.0;
    for response in 0..responses {
        match (robo_coder[response], bionic_solver[response]) {
            ("1", "0") => only_robo_coder_wins += 1.0,
            ("0", "1") => only_bionic_solver_wins += 1.0,
            _ => (),
        }
    }
    let robo_code_minimum_points: f64 = if only_robo_coder_wins == 0.0 {
        -1.0
    } else {
        (only_bionic_solver_wins + 1.0) / only_robo_coder_wins
    };
    println!("{}", robo_code_minimum_points.ceil() as i32);
}


#[doc = " https://github.com/hatoo/competitive-rust-snippets"]
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[macro_export]
macro_rules ! chmax { ( $ x : expr , $ ( $ v : expr ) ,+ ) => { $ ( $ x = std :: cmp :: max ( $ x ,$ v ) ; ) + } ; }
#[macro_export]
macro_rules ! chmin { ( $ x : expr , $ ( $ v : expr ) ,+ ) => { $ ( $ x = std :: cmp :: min ( $ x ,$ v ) ; ) + } ; }
#[macro_export]
macro_rules ! max { ( $ x : expr ) => ( $ x ) ; ( $ x : expr , $ ( $ xs : expr ) ,+ ) => { std :: cmp :: max ( $ x , max ! ( $ ( $ xs ) ,+ ) ) } ; }
#[macro_export]
macro_rules ! min { ( $ x : expr ) => ( $ x ) ; ( $ x : expr , $ ( $ xs : expr ) ,+ ) => { std :: cmp :: min ( $ x , min ! ( $ ( $ xs ) ,+ ) ) } ; }
#[macro_export]
macro_rules ! dvec { ( $ t : expr ; $ len : expr ) => { vec ! [ $ t ; $ len ] } ; ( $ t : expr ; $ len : expr , $ ( $ rest : expr ) ,* ) => { vec ! [ dvec ! ( $ t ; $ ( $ rest ) ,* ) ; $ len ] } ; }
#[macro_export]
macro_rules ! cfor { ( ; $ ( $ rest : tt ) * ) => { cfor ! ( ( ) ; $ ( $ rest ) * ) } ; ( $ ( $ init : stmt ) ,+; ; $ ( $ rest : tt ) * ) => { cfor ! ( $ ( $ init ) ,+; ! false ; $ ( $ rest ) * ) } ; ( $ ( $ init : stmt ) ,+; $ cond : expr ; ; $ body : block ) => { cfor ! { $ ( $ init ) ,+; $ cond ; ( ) ; $ body } } ; ( $ ( $ init : stmt ) ,+; $ cond : expr ; $ ( $ step : expr ) ,+; $ body : block ) => { { $ ( $ init ; ) + while $ cond { let mut _first = true ; let mut _continue = false ; loop { if ! _first { _continue = true ; break } _first = false ; $ body } if ! _continue { break } $ ( $ step ; ) + } } } ; }
#[doc = " main"]
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};
#[macro_export]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut parser = Parser :: from_str ( $ s ) ; input_inner ! { parser , $ ( $ r ) * } } ; ( parser = $ parser : ident , $ ( $ r : tt ) * ) => { input_inner ! { $ parser , $ ( $ r ) * } } ; ( new_stdin_parser = $ parser : ident , $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let reader = std :: io :: BufReader :: new ( stdin . lock ( ) ) ; let mut $ parser = Parser :: new ( reader ) ; input_inner ! { $ parser , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { input ! { new_stdin_parser = parser , $ ( $ r ) * } } ; }
#[macro_export]
macro_rules ! input_inner { ( $ parser : ident ) => { } ; ( $ parser : ident , ) => { } ; ( $ parser : ident , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ parser , $ t ) ; input_inner ! { $ parser $ ( $ r ) * } } ; }
#[macro_export]
macro_rules ! read_value { ( $ parser : ident , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ parser , $ t ) ) ,* ) } ; ( $ parser : ident , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ parser , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ parser : ident , chars ) => { read_value ! ( $ parser , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ parser : ident , usize1 ) => { read_value ! ( $ parser , usize ) - 1 } ; ( $ parser : ident , $ t : ty ) => { $ parser . next ::<$ t > ( ) . expect ( "Parse error" ) } ; }
use std::io;
use std::io::BufRead;
use std::str;
pub struct Parser<R> {
    reader: R,
    buf: Vec<u8>,
    pos: usize,
}
impl Parser<io::Empty> {
    pub fn from_str(s: &str) -> Parser<io::Empty> {
        Parser {
            reader: io::empty(),
            buf: s.as_bytes().to_vec(),
            pos: 0,
        }
    }
}
impl<R: BufRead> Parser<R> {
    pub fn new(reader: R) -> Parser<R> {
        Parser {
            reader: reader,
            buf: vec![],
            pos: 0,
        }
    }
    pub fn update_buf(&mut self) {
        self.buf.clear();
        self.pos = 0;
        loop {
            let (len, complete) = {
                let buf2 = self.reader.fill_buf().unwrap();
                self.buf.extend_from_slice(buf2);
                let len = buf2.len();
                if len == 0 {
                    break;
                }
                (len, buf2[len - 1] <= 0x20)
            };
            self.reader.consume(len);
            if complete {
                break;
            }
        }
    }
    pub fn next<T: str::FromStr>(&mut self) -> Result<T, T::Err> {
        loop {
            let mut begin = self.pos;
            while begin < self.buf.len() && (self.buf[begin] <= 0x20) {
                begin += 1;
            }
            let mut end = begin;
            while end < self.buf.len() && (self.buf[end] > 0x20) {
                end += 1;
            }
            if begin != self.buf.len() {
                self.pos = end;
                return str::from_utf8(&self.buf[begin..end]).unwrap().parse::<T>();
            } else {
                self.update_buf();
            }
        }
    }
}
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) ; } }
#[doc = " https://github.com/hatoo/competitive-rust-snippets"]
const BIG_STACK_SIZE: bool = true;
#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}
fn solve() {
    let out = stdout();
    let mut out = BufWriter::new(out.lock());
    input!{
        n:usize,
        a:[u8;n],
        b:[u8;n],
    }
    let mut acnt = 0;
    let mut btot = 0;
    for i in 0..n {
        if a[i] == b[i] {
        } else {
            if a[i] == 1 {
                acnt += 1;
            } else {
                btot += 1;
            }
        }
    }
    if acnt == 0 {
        writeln!(out,"-1");
        return
    }
    let ars = ArithSeq::new(0,acnt);
    let nxt = ars.next(btot+1);
    writeln!(out,"{}",nxt/acnt);
}
struct ArithSeq {
    a: i64,
    b: i64,
}
impl ArithSeq {
    pub fn new(a: i64, b: i64) -> ArithSeq {
        assert!(b > 0);
        ArithSeq { a: a, b: b }
    }
    #[doc = "a+bi >= x"]
    pub fn next(&self, x: i64) -> i64 {
        if x >= self.a {
            let d = x - self.a;
            let i = (d - 1 + self.b) / self.b;
            self.a + self.b * i
        } else {
            let d = self.a - x;
            let i = d / self.b;
            self.a - self.b * i
        }
    }
    #[doc = "a+bi <= x"]
    pub fn prev(&self, x: i64) -> i64 {
        let next = self.next(x);
        if next == x {
            x
        } else {
            next - self.b
        }
    }
    #[doc = "[a+bi, n] <= [l, u]"]
    pub fn range(&self, l: i64, u: i64) -> Option<(i64, i64)> {
        if l > u {
            return None;
        }
        let x = self.next(l);
        let y = self.prev(u);
        if x > y {
            return None;
        }
        assert!(x <= y);
        if l <= x && x <= u {
            let cnt = (y - x) / self.b;
            Some((x, cnt + 1))
        } else {
            None
        }
    }
}


use std::io::stdin;

#[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 n = scan.next::<usize>();
    let mut a = Vec::with_capacity(n);
    for _ in 0..n {
        a.push(scan.next::<i32>());
    }
    let mut b = Vec::with_capacity(n);
    for _ in 0..n {
        b.push(scan.next::<i32>());
    }
    let mut num_a = 0;
    let mut num_b = 0;
    for i in 0..n {
        if b[i] == 0 && a[i] == 1 {
            num_a += 1;
        } else if b[i] == 1 && a[i] == 0 {
            num_b += 1;
        }
    }
    let mut ans;
    if num_a == 0 {
        ans = -1;
    } else {
        ans = 1;
        while num_a * ans <= num_b {
            ans += 1;
        }
    }
    println!("{}", ans);
}


use std::io::{self, BufRead};

fn main() {
    let stdin = io::stdin();
    let mut lines = stdin.lock().lines();
    let _ = lines.next().unwrap().unwrap().parse::<i32>().unwrap();
    let a: Vec<i32> = lines.next().unwrap().unwrap().split(" ").map(|s| s.parse::<i32>().unwrap()).collect();
    let b: Vec<i32> = lines.next().unwrap().unwrap().split(" ").map(|s| s.parse::<i32>().unwrap()).collect();
    println!("{}", solve(a, b).unwrap_or(-1));
}

pub fn solve( a: Vec<i32>, b: Vec<i32>) -> Option<i32> {
    let b_score = a.iter().zip(b.iter()).fold(0, |mut acc, (x,y)| {
        if x < y {
            acc += 1;
        }
        acc
    });
    let outperform = a.iter().zip(b.iter()).fold(0, |mut acc, (x,y)| {
        if x > y {
            acc += 1;
        }
        acc
    });
    match outperform {
        0 => None,
        r => Some(b_score / outperform + 1),
    }
}


fn main() {
    let data = read_input();
    let (n, a, b, c) = (data[0], data[1], data[2], data[3]);

    let mut max_count = 0;

    let d = n / a;
    for i in 0..=d {
        let rem = n - a * i;
        let d = rem / b;
        for j in 0..=d {
            let rem = n - a * i - b * j;
            let d = rem / c;
            let x = a * i + b * j + c * d;
            let count = i + j + d;
            if x == n && count > max_count {
                max_count = count;
            }
        }
    }

    println!("{}", max_count);
}
fn read_input() -> Vec<isize> {
    let mut buffer = String::new();

    std::io::stdin()
        .read_line(&mut buffer)
        .expect("Failed to get input");

    buffer
        .trim()
        .split_whitespace()
        .map(|x| x.parse().expect("Failed to parse number"))
        .collect()
}


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

fn get_max_division_size(n: u16, a: u16, b: u16, c: u16) -> u16 {
    let mut max_division_size: u16 = 0;

    for num_a in 0..(n / a + 1) {
        let size_left1: u16 = n - num_a * a;
        for num_b in 0..(size_left1 / b + 1) {
            let size_left2: u16 = size_left1 - num_b * b;
            if (size_left2 % c) == 0 {
                let num_c: u16 = size_left2 / c;
                let division_size = num_a + num_b + num_c;
                if division_size > max_division_size {
                    max_division_size = division_size;
                }
            }
        }
    }

    return max_division_size;
}

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

    #[test]
    fn test1() {
        assert_eq!(get_max_division_size(5, 5, 3, 2), 2);
    }

    #[test]
    fn test2() {
        assert_eq!(get_max_division_size(7, 5, 5, 2), 2);
    }

    #[test]
    fn test3() {
        assert_eq!(get_max_division_size(10, 1, 1, 1), 10);
    }
}

fn main() {
    let stdin = stdin();
    let mut stdin_lock = stdin.lock();
    let stdout = stdout();
    let mut stdout_lock = stdout.lock();

    let mut parameters_string: String = String::new();
    stdin_lock.read_line(&mut parameters_string).unwrap();
    let parameters_vec: Vec<u16> = parameters_string
        .trim()
        .split_whitespace()
        .map(|s| s.parse().unwrap())
        .collect();
    let n: u16 = parameters_vec[0];
    let a: u16 = parameters_vec[1];
    let b: u16 = parameters_vec[2];
    let c: u16 = parameters_vec[3];
    let result: u16 = get_max_division_size(n, a, b, c);

    writeln!(stdout_lock, "{}", result).unwrap();
}


use std::collections::HashMap;
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 main() {
    // initialize stdin
    let sin = std::io::stdin();
    let mut sin = sin.lock();
    let sin = &mut sin;

    let params: Vec<i64> = reads(sin);

    let n = params[0];
    let a = params[1];
    let b = params[2];
    let c = params[3];

    let lengths: Vec<i64> = vec![a, b, c];

    let min = *(lengths.iter().min().unwrap());
    if n % min == 0 {
        println!("{}", n / min);
        return;
    }

    let mut memo = HashMap::new();
    memo.insert(0, 0);

    (min..n + 1).for_each(|x| {
        let mut tmp: Vec<i64> = Vec::new();
        for length in &lengths {
            if let Some(val) = memo.get(&(x - length)) {
                tmp.push(val + 1);
            }
        }
        if tmp.len() == 0 {
            return;
        }

        let max_ribons: i64 = tmp.into_iter().max().unwrap();

        memo.insert(x, max_ribons);
    });

    println!("{}", memo.entry(n).or_insert(0));
}


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

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

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

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

    let n = words[0];
    let a = words[1];
    let b = words[2];
    let c = words[3];

    let mut maxima = -1;
    for i in 0..4001 {
        for j in 0..4001 {
            let m = n - a*i - b*j;
            if m >= 0 && m%c == 0 {
                maxima = std::cmp::max(maxima, i+j+m/c);
            }
        }
    }

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


// 2018-10-11 17:24
use std::collections::HashMap;
fn main() {
    let v: Vec<i32> = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().split(" ").map(|s| s.parse::<i32>().unwrap()).collect()
    };
    let (n, a, b, c) = (v[0], v[1], v[2], v[3]);

    let mut dp: HashMap<i32, i32> = HashMap::new();
    dp.insert(0, 0);

    for i in 0..n + 1 {
        let mut m = 0;
        if dp.contains_key(&(i - a)) {
            m = std::cmp::max(m, dp[&(i - a)] + 1);
        }
        if dp.contains_key(&(i - b)) {
            m = std::cmp::max(m, dp[&(i - b)] + 1);
        }
        if dp.contains_key(&(i - c)) {
            m = std::cmp::max(m, dp[&(i - c)] + 1);
        }
        if m != 0 {
            dp.insert(i, m);
        }
    }
    println!("{:?}", dp[&n]);
}


use std::io;

fn read_line() -> String {
    let mut input_line = String::new();
    io::stdin().read_line(&mut input_line).unwrap();
    return String::from(input_line.trim());
}

fn read_line_vec() -> Vec<i64> {
    return read_line().split(' ')
        .map(|s| s.parse().unwrap())
        .collect();
}

fn read_line_tuple4() -> (i64, i64, i64, i64) {
    let vec = read_line_vec();
    return (vec[0], vec[1], vec[2], vec[3]);
}

fn main() {
    let (n, a, b, c) = read_line_tuple4();

    let mut cost = Vec::new();
    cost.push(0i64);

    for i in 1..(n + 1) as usize {
        let ca = if i as i64 >= a { cost[i - a as usize] + 1 } else { i64::min_value() };
        let cb = if i as i64 >= b { cost[i - b as usize] + 1 } else { i64::min_value() };
        let cc = if i as i64 >= c { cost[i - c as usize] + 1 } else { i64::min_value() };
        let m = *[ca, cb, cc].iter().max().unwrap();
        // println!("{} {}", i, m);
        cost.push(m);
    }

    println!("{}", cost[n as usize]);
    // println!("{:?}", [3,6,8].iter().max().unwrap());

}


fn minimun_cuts(n: i32, options: &[i32]) -> i32 {
    let mut table = vec![vec![-1; options.len()]; n as usize + 1];

    fn traverse(mut n: i32, options: &[i32], table: &mut Vec<Vec<i32>>) -> i32 {
        for (i, option) in options.iter().enumerate() {
            if table[n as usize][i] == -1 {
                let mut push_value = -5000;
                let conditional = n - option;
                if conditional == 0 {
                    push_value = 1;
                } else if conditional > 0 {
                    n -= option;
                    push_value = 1 + traverse(n, options, table);
                    n += option;
                }
                table[n as usize][i] = push_value;
            }
        }
        *table[n as usize].iter().max().unwrap()
    }

    traverse(n, options, &mut table)
}

fn main() {
    let mut variables = String::new();
    std::io::stdin().read_line(&mut variables).unwrap();
    let variables: Vec<i32> = variables
        .split_whitespace()
        .map(|string| string.trim().parse().ok().unwrap())
        .collect();
    let n = variables[0];
    let (a, b, c) = (variables[1], variables[2], variables[3]);
    println!("{}", minimun_cuts(n, &[a, b, c]));
}


fn read() -> String {
    let mut res = String::new();
    std::io::stdin().read_line(&mut res).expect("???");
    res
}

fn parse_int(s: &str) -> usize {
    s.trim().parse().expect("???")
}

fn parse_ints(s: &str) -> Vec<usize> {
    s.split_whitespace().map(parse_int).collect()
}

fn main() {
    let v = parse_ints(&read());
    let n = v[0];
    let a = v[1];
    let b = v[2];
    let c = v[3];

    let mut arr = vec![-1; n+1];
    arr[n] = 0;

    for i in (0..n+1).rev() {
        // println!("{:?}", arr);
        let x = arr[i];
        if x > -1 {
            if i >= a {
                arr[i-a] = std::cmp::max(arr[i-a], x+1);
            }
            if i >= b {
                arr[i-b] = std::cmp::max(arr[i-b], x+1);
            }
            if i >= c {
                arr[i-c] = std::cmp::max(arr[i-c], x+1);
            }
        }
    }
    println!("{}", arr[0]);
}


use std::collections::HashSet;
use std::io::stdin;

fn solve(n: i32) -> i32 {
    let mut set = HashSet::new();
    for i in 1i128..=((n as f64).sqrt().floor() as i128) {
        set.insert(i*i);
        if i*i*i <= n as i128 {
            set.insert(i * i * i);
        }
    }
    set.len() as i32
}

fn main() {
    let mut input = Scanner::default();
    let t = input.read_int();
    for _ in 0..t {
        println!("{}", solve(input.read_int()));
    }
}

/// TEMPLATE
#[derive(Default)]
struct Scanner {
    buffer: Vec<String>
}
impl Scanner {
    fn read_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 read_int(&mut self) -> i32 {
        self.read_next::<i32>()
    }
}

/// TESTS
#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn example1() {
        assert_eq!(solve(10), 4);
    }

    #[test]
    fn example2() {
        assert_eq!(solve(1), 1);
    }

    #[test]
    fn example3() {
        assert_eq!(solve(25), 6);
    }

    #[test]
    fn example4() {
        assert_eq!(solve(1000000000), 32591);
    }

    #[test]
    fn example5() {
        assert_eq!(solve(999999999), 32590);
    }

    #[test]
    fn example6() {
        assert_eq!(solve(500000000), 23125);
    }

    #[test]
    fn example7() {
        assert_eq!(solve(2), 1);
    }

    #[test]
    fn example8() {
        assert_eq!(solve(3), 1);
    }

    #[test]
    fn example9() {
        assert_eq!(solve(4), 2);
    }

    #[test]
    fn example10() {
        assert_eq!(solve(5), 2);
    }

    #[test]
    fn example11() {
        assert_eq!(solve(6), 2);
    }
}


use std::cmp::{
    max, min,
    Ordering::{Equal, Greater, Less},
    Reverse,
};
use std::collections::{self, BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::convert::{From, Into, TryFrom, TryInto};
use std::io::{self, BufRead, BufReader, BufWriter, Write};
use std::iter::{FromIterator, IntoIterator};
use std::marker::PhantomData;

macro_rules! new_bufio {
    () => {{
        (io::stdin(), io::stdout(), String::new())
    }};
}
macro_rules! init_lockedio {
    ($cin: expr, $cout: expr) => {{
        (BufReader::new($cin.lock()), BufWriter::new($cout.lock()))
    }};
}
macro_rules! scanf {
    ($buf: expr, $div: expr, $($x: ty), +) => {{
        let mut iter = $buf.split($div);
        ($(iter.next().and_then(|token| token.parse::<$x>().ok()),)*)
    }};
}
macro_rules! scan_array {
    ($buf: expr, $div: expr, $x: ty) => {{
        $buf.split($div)
            .filter(|tok| tok.parse::<$x>().is_ok())
            .map(|tok| tok.parse::<$x>().unwrap())
            .collect::<Vec<$x>>()
    }};
}
macro_rules! getline {
    ($cin: expr, $buf: expr) => {{
        $buf.clear();
        $cin.read_line(&mut $buf)?;
    }};
}
macro_rules! map_or_insert {
    ($map: expr, $key: expr, $fn: expr, $val: expr) => {{
        match $map.get_mut(&$key) {
            Some(v) => {
                $fn(v);
            }
            None => {
                $map.insert($key, $val);
            }
        }
    }};
}
macro_rules! lowbit {
    ($x: expr) => {{
        $x & (!$x + 1)
    }};
}
macro_rules! index {
    ($ch: expr) => {{
        ($ch - b'a') as usize
    }};
}

fn main() -> io::Result<()> {
    let (cin, cout, mut buf) = new_bufio!();
    let (mut cin, mut cout) = init_lockedio!(cin, cout);
    getline!(cin, buf);
    if let (Some(mut n), ) = scanf!(buf, char::is_whitespace, usize) {
        while n > 0 {
            getline!(cin, buf);
            if let (Some(x), ) = scanf!(buf, char::is_whitespace, i32) {
                let (mut sq, mut cu, mut si) = (0i32, 0i32, 0i32);
                for _ in 0..x {
                    if si.pow(6) > x {
                        break;
                    }
                    si += 1;
                }
                if si.pow(6) > x { si -= 1 };
                for _ in 0..x {
                    if cu.pow(3) > x {
                        break;
                    }
                    cu += 1;
                }
                if cu.pow(3) > x { cu -= 1 };
                for _ in 0..x {
                    if sq.pow(2) > x {
                        break;
                    }
                    sq += 1;
                }
                if sq.pow(2) > x { sq -= 1 };
                writeln!(cout, "{0}", sq + cu - si)?;
            }
            n -= 1;
        }
    }
    Ok(())
}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    let tests = sc.usize();
    for _ in 0..tests {
        let n = sc.i64();
        let mut cache: HashSet<i64> = HashSet::new();
        for i in 1..=n {
            if i * i > n { break; }
            cache.insert(i * i);
        }
        for i in 1..=n {
            if i * i * i > n { break; }
            cache.insert(i * i * i);
        }
        writeln!(out, "{}", cache.len());
    }
}


use std::collections::HashSet;
use std::io::stdin;

#[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 t = scan.next::<usize>();

    let mut v = HashSet::new();

    let mut i = 1;
    while i * i <= 10_usize.pow(9) {
        v.insert(i * i);
        i += 1;
    }
    let mut i = 1;
    while i * i * i <= 10_usize.pow(9) {
        v.insert(i * i * i);
        i += 1;
    }

    for _ in 0..t {
        let n = scan.next::<usize>();
        let mut ans = 0;
        for k in v.iter() {
            if k <= &n {
                ans += 1;
            }
        }
        println!("{}", ans);
    }
}


struct Scanner<R> {
    reader: R,
    line: Vec<u8>,
    ptr: usize

}

impl<R: std::io::BufRead> Scanner<R> {
    fn new(reader: R) -> Self {
        Self{reader, line: vec![], ptr: 0}
    }

    fn scan<T: std::str::FromStr>(&mut self) -> T {
        loop {
            while self.ptr < self.line.len() && self.line[self.ptr].is_ascii_whitespace() {
                self.ptr += 1;
            }
            if self.ptr != self.line.len() {
                let start = self.ptr;
                while self.ptr < self.line.len() && !self.line[self.ptr].is_ascii_whitespace() {
                    self.ptr += 1;
                }
                return std::str::from_utf8(&self.line[start..self.ptr]).unwrap().parse().ok().
                    expect("parse error");
            }
            self.line.clear();
            self.reader.read_until(b'\n', &mut self.line).expect("read error");
            self.ptr = 0;
        }
    }

    fn line(&mut self) -> Vec<u8> {
        while self.ptr < self.line.len() && self.line[self.ptr].is_ascii_whitespace() {
            self.ptr += 1;
        }
        if self.ptr == self.line.len() {
            self.line.clear();
            self.reader.read_until(b'\n', &mut self.line).expect("read error");
            self.ptr = 0;
        }
        let result = self.line[self.ptr..].to_vec();
        self.ptr = self.line.len();
        return result;
    }

    fn eof(&mut self) -> bool {
        loop {
            while self.ptr < self.line.len() && self.line[self.ptr].is_ascii_whitespace() {
                self.ptr += 1;
            }
            if self.ptr != self.line.len() {
                return false;
            }
            self.line.clear();
            self.ptr = 0;
            if let Ok(0) = self.reader.read_until(b'\n', &mut self.line) {
                return true;
            }
        }
    }

}

fn binary_search<F: Fn(i64) -> bool>(n: i64, f: F) -> i64 {
    let mut l = 0;
    let mut r = n;
    while l + 1 < r {
        let m = (l + r) / 2;
        if f(m) {
            l = m;
        } else {
            r = m;
        }
    }
    return l;
}

fn solve<R: std::io::BufRead, W: std::io::Write>(scanner: &mut Scanner<R>, writer: &mut W) {
    let n: i64 = scanner.scan();
    let squares = binary_search(100000, |x| x * x <= n);
    let cubes = binary_search(10000, |x| x * x * x <= n);
    let sixs = binary_search(100, |x| x * x * x * x * x * x <= n);
    let result = squares + cubes - sixs;
    writeln!(writer, "{}", result).unwrap();
}

fn main() {
    let (stdin, stdout) = (std::io::stdin(), std::io::stdout());
    let mut writer = std::io::BufWriter::new(stdout.lock());
    let mut scanner = Scanner::new(stdin.lock());
    let tests: usize = scanner.scan();
    for _ in 0..tests {
        solve(&mut scanner, &mut writer);
    }
}


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

fn main() {
    let stdout = stdout();
    let mut bw = BufWriter::new(stdout);

    let stdin = stdin();
    let mut br = BufReader::new(stdin);
    let mut num_tests_str = String::new();
    br.read_line(&mut num_tests_str).unwrap();
    let num_tests: usize = num_tests_str.trim_end().parse::<usize>().unwrap();

    for _ in 0..num_tests {
        let mut n_string = String::new();
        br.read_line(&mut n_string).unwrap();
        let n: usize = n_string.trim_end().parse().unwrap();
        let squares = count_powers_less_than(2, n);
        let cubes = count_powers_less_than(3, n);
        let sixth_powers = count_powers_less_than(6, n);
        let answer = squares + cubes - sixth_powers;
        writeln!(bw, "{}", answer).expect("Could not write to stdout");
    }
}

fn count_powers_less_than(exponent: u32, n: usize) -> usize {
    let count: usize = (1..=n)
        .into_iter()
        .take_while(|i| i.pow(exponent) <= n)
        .count();
    count
}


fn read_i64() -> i64 {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.trim().parse().unwrap()
}

fn bsearch<F: Fn(i64) -> bool>(mut lo: i64, mut hi: i64, f: F) -> i64 {
    while lo < hi {
        let mi = lo + (hi - lo) / 2;
        if f(mi) {
            hi = mi;
        } else {
            lo = mi + 1;
        }
    }
    hi
}

fn count(m: i64, n: i64) -> i64 {
    bsearch(1, m + 1, |x| {
        let mut y = m;
        for _ in 0..n {
            y /= x
        }
        y == 0
    }) - 1
}

fn main() {
    let re = read_i64();
    for _ri in 0..re {
        let t = read_i64();
        println!("{}", count(t, 2) + count(t, 3) - count(t, 6));
    }
}


fn readln() -> String {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    String::from(line.trim())
}
fn readi() -> i64 { readln().parse().unwrap() }
fn readv() -> Vec<i64> { readln().split(" ").map(|x| x.parse::<i64>().unwrap()).collect() }
fn main() {
    let t = readi();
    for T in 1..=t {
        let n = readi();
        let mut ans = 0;
        for i in 1i64.. {
            if i.pow(2) <= n {ans += 1;} else { break; }
        }
        for i in 1i64.. {
            if i.pow(3) <= n {ans += 1;} else { break; }
        }
        for i in 1i64.. {
            if i.pow(6) <= n {ans -= 1;} else { break; }
        }
        println!("{}", ans);
    }
}


use std::io;
use std::ascii::AsciiExt;

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

fn main() {

    let line = read_line();
    let is_cap = line.trim().chars().skip(1).all(|ch| ch.is_uppercase());

    if !is_cap {
        print!("{}", line);
    } else {
        print!("{}", line.trim().chars().map(|ch| if ch.is_uppercase() { ch.to_ascii_lowercase() } else { ch.to_ascii_uppercase() }).collect::<String>());
    }
}


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

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

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

// Functions

// Main
fn main() {

    input! {
        mut W: chars,
    }

    let mut f = true;
    for i in 1..W.len(){
        if W[i].is_ascii_lowercase() {
            f = false;
            break;
        }
    }

    if f {
        for i in 0..W.len() {
            if W[i].is_ascii_lowercase() {
                W[i] = W[i].to_ascii_uppercase();
            } else {
                W[i] = W[i].to_ascii_lowercase();
            }
        }
    }

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


use std::io::*;

fn read<T: std::str::FromStr>(i: &mut StdinLock) -> T {
    let mut s = String::new();
    i.by_ref().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn is_change_target(s: &String) -> bool {
    let mut is_first_char = true;

    for c in s.as_str().chars() {
        if is_first_char {
            is_first_char = false;
            continue;
        }

        if c.is_uppercase() == false {
            return false;
        }
    }

    true
}

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

    let input: String = read(sin);

    if !is_change_target(&input) {
        println!("{}", input);
        return;
    }

    for c in input.as_str().chars() {
        if c.is_lowercase() {
            print!("{}", c.to_uppercase().nth(0).unwrap());
            continue;
        }
        print!("{}", c.to_lowercase().nth(0).unwrap());
    }
    println!("");
}


fn main() {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line);
    let line = line.trim();
    let s0 = line.to_string().to_uppercase();
    let ss = s0.as_str();
    let s1 = (&ss[0..1]).to_string().to_lowercase() + &s0[1..];

    let s2 = line.to_string().to_lowercase();
    let s3 = (&ss[0..1]).to_string().to_uppercase() + &s2[1..];

    if s0.eq(line) {
        println!("{}", s2);
    } else if s1.eq(line) {
        println!("{}", s3);
    } else {
        println!("{}", line);
    }
}


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

pub struct Scanner<U: Sized + Read> {
    pub buffer: Vec<String>,
    pub reader: U,
}
impl<U: Sized + Read> Scanner<U> {
    pub 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();
            self.reader.read_to_string(&mut input).expect("Failed read");
            self.buffer = input.lines().rev().map(String::from).collect();
        }
    }

    pub fn new(reader: U) -> Self {
        return Scanner {
            buffer: vec![],
            reader,
        };
    }
}

pub fn solution_of_p131a(input: &mut Read, out: &mut Write) {
    let mut scanner = Scanner::new(input);
    let line = scanner.next::<String>();
    if line.len() == 1 {
        let c = line.chars().nth(0).unwrap();
        if c.is_ascii_uppercase() {
            write!(out, "{}", line.to_ascii_lowercase()).ok();
        } else {
            write!(out, "{}", line.to_ascii_uppercase()).ok();
        }
    } else if only_uppercase(&line) {
        write!(out, "{}", line.to_ascii_lowercase()).ok();
    } else if uppercase_except_first(&line) {
        write!(out, "{}{}", &line[0..1].to_ascii_uppercase(), &line[1..].to_ascii_lowercase()).ok();
    } else {
        write!(out, "{}", line).ok();
    }
}

fn only_uppercase(s: &str) -> bool {
    for c in s.chars() {
        if c.is_ascii_lowercase() {
            return false;
        }
    }
    return true;
}

fn uppercase_except_first(s: &str) -> bool {
    let first_c = s.chars().nth(0).unwrap();
    if first_c.is_ascii_uppercase() {
        return false;
    }
    for c in (&s[1..]).chars() {
        if c.is_ascii_lowercase() {
            return false;
        }
    }
    return true;
}

fn main() {
    solution_of_p131a(&mut stdin(), &mut stdout());
}


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

fn solve(input: &mut Read, output: &mut Write) {
    let mut sin = String::new();
    input.read_to_string(&mut sin).unwrap();
    let sin = sin.lines().next().unwrap().trim();
    let res: String;
    if sin.chars().skip(1).all(|x| x.is_uppercase()) || (sin.chars().count() == 1 && sin.chars().next().unwrap().is_uppercase()) {
        let mut chars = sin.chars();
        let first = chars.next().unwrap();
        let first: String = if first.is_uppercase() { first.to_lowercase().collect() } else { first.to_uppercase().collect() };
        res = first + &chars.collect::<String>().to_lowercase();
    } else {
        res = sin.to_string();
    }

    output.write(res.to_string().trim().as_bytes()).unwrap();
}

fn main() {
    solve(&mut io::stdin(), &mut io::stdout());
}

#[cfg(test)]
mod tests {
    use std::fs::File;
    use std::io::Read;
    use solve;

    #[test]
    fn test() {
        (1..1 + 1).map(|x| {
            println!("test #{}", x);
            let mut fin = File::open("./src/in".to_string() + &x.to_string() + ".txt").unwrap();
            let mut buf: Vec<u8> = Vec::new();
            solve(&mut fin, &mut buf);
            let res = String::from_utf8(buf).unwrap();

            let mut fout = File::open("./src/out".to_string() + &x.to_string() + ".txt").unwrap();
            let mut sout = String::new();
            fout.read_to_string(&mut sout).unwrap();
            assert_eq!(res, sout.trim());

        }).count();

    }
}


use std::io;

fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();

    let mut caps = true;

    for (i, c) in s.chars().enumerate() {
        if i != 0 {
            if c.is_lowercase() {
                caps = false;
            }
        }
    }

    if caps {
        let mut temp = String::new();
        for c in s.chars() {
            if c.is_lowercase() {
                temp.push(c.to_ascii_uppercase());
            } else {
                temp.push(c.to_ascii_lowercase());
            }
        }

        print!("{}", temp);
    } else {
        print!("{}", s);
    }
}


use std::io;
fn main(){
    println!("{}",operation());
}
fn operation() -> String {
    let (simple,word)=input();
    if word[0].is_lowercase(){
        if word.len()==1{
            return (simple.to_uppercase()).to_string()
        }
        if word[1].is_lowercase(){
            return simple
        }
        let mut n=0;
        for i in 1..word.len(){
            if word[i].is_uppercase(){
                n+=1;
            }
        }
        if n+1==word.len(){
            let mut sum=(word[0].to_uppercase()).to_string();
            for i in 1..word.len(){
                sum+=&((word[i].to_lowercase()).to_string());
            }
            return sum;
        }
    }
    else{
        if word.len()==1{
            return (simple.to_lowercase()).to_string()
        }
        let mut n=0;
        for i in 0..word.len(){
            if word[i].is_uppercase(){
                n+=1;
            }
        }
        if n==word.len(){
            return (simple.to_lowercase()).to_string()
        }
    }
    return simple
}
fn read() -> String{
    let mut input=String::new();
    io::stdin().read_line(&mut input).expect("unable to read");
    input.trim().to_string()
}

fn input() -> (String,Vec<char>){
    let inp=read();
    let l:Vec<char>=inp.chars().collect();
    (inp,l)
}
/*  let n=read().parse::<i32>().expect("Failed to parse");
    let inp=read();
    (n,inp.split_whitespace().map(|x| x.parse::<i32>().expect("Failed to parse")).collect())
    let list: Vec<_>=inp.split_whitespace().collect();
    let qu: Vec<_>=read().chars().collect();
    (list[0].parse::<i32>().expect("Failed to parse"),
    list[1].parse::<i32>().expect("Failed to parse"),qu)
*/


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"),
            )+
        )
    })
}

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

use std::io::Write;

fn solve(writer: &mut std::io::BufWriter<std::io::Stdout>) {
    let (l, r) = parse_line!(u64, u64);
    let mut bit = 1u64 << 63;
    while bit != 0 && l & bit == r & bit {
        bit >>= 1;
    }
    if bit == 0 {
        writeln!(writer, "0").unwrap();
    }else{
        writeln!(writer, "{}", bit | (bit - 1)).unwrap();
    }
}

fn main() {
    let mut writer = std::io::BufWriter::new(std::io::stdout());
    let tests = 1; // parse_line!(usize);
    for _ in 0..tests {
        solve(&mut writer);
    }
}


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

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

    l!(l,r: i64 = input.p());
    if l == r {
        println!("0");
    } else {
        let mut x = l ^ r;
        for i in 0..=5 {
            x |= x >> (1 << i);
        }
        println!("{}", x);
    }
}