fn main() {
    #![allow(unused_imports, unused_macros)]
    prepare_io!(_in_buf, scanner, _out);
    macro_rules ! print { ($ ($ arg : tt) *) => (:: std :: write ! (_out , $ ($ arg) *) . expect ("io error")) }
    macro_rules ! println { ($ ($ arg : tt) *) => (:: std :: writeln ! (_out , $ ($ arg) *) . expect ("io error")) }
    scan!(scanner, n);
    let pt = PrimeTable::new(n as _);
    let mut ans = M::zero();
    let mut acc = M::zero();
    for i in 1..=n {
        let c = pt.count_divisors(i as _);
        ans = acc + M::from(c);
        acc += ans;
    }
    println!("{}", ans);
}
pub type M = mint_basic::MInt998244353;
#[macro_export]
macro_rules! prepare_io {
    ($ in_buf : ident , $ scanner : ident , $ out : ident) => {
        use std::io::{stdout, BufWriter, Write as _};
        let $in_buf = read_stdin_all_unchecked();
        let mut $scanner = Scanner::new(&$in_buf);
        let $out = stdout();
        let mut $out = BufWriter::new($out.lock());
    };
}
pub fn echo<T: std::fmt::Display>(
    mut writer: impl std::io::Write,
    iter: impl IntoIterator<Item = T>,
    sep: impl std::fmt::Display,
) -> std::io::Result<()> {
    let mut iter = iter.into_iter();
    if let Some(item) = iter.next() {
        write!(writer, "{}", item)?;
    }
    for item in iter {
        write!(writer, "{}{}", sep, item)?;
    }
    writeln!(writer)
}
pub fn read_stdin_all_unchecked() -> String {
    use std::io::Read as _;
    let mut buf = Vec::new();
    std::io::stdin().read_to_end(&mut buf).expect("io error");
    unsafe { String::from_utf8_unchecked(buf) }
}
pub fn read_stdin_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).expect("io error");
    s
}
pub use scanner_impls::{IterScan, MarkedIterScan, Scanner};
mod scanner_impls {
    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>,
    }
    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>(&mut self) -> <T as IterScan>::Output
        where
            T: IterScan,
        {
            <T as IterScan>::scan(&mut self.iter).expect("scan error")
        }
        #[inline]
        pub fn mscan<T>(&mut self, marker: T) -> <T as MarkedIterScan>::Output
        where
            T: MarkedIterScan,
        {
            marker.mscan(&mut self.iter).expect("scan error")
        }
        #[inline]
        pub fn scan_vec<T>(&mut self, size: usize) -> Vec<<T as IterScan>::Output>
        where
            T: IterScan,
        {
            (0..size)
                .map(|_| <T as IterScan>::scan(&mut self.iter).expect("scan error"))
                .collect()
        }
        #[inline]
        pub fn iter<'b, T>(&'b mut self) -> ScannerIter<'a, 'b, T>
        where
            T: IterScan,
        {
            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> Iterator for ScannerIter<'a, 'b, T>
    where
        T: IterScan,
    {
        type Item = <T as IterScan>::Output;
        #[inline]
        fn next(&mut self) -> Option<Self::Item> {
            <T as IterScan>::scan(&mut self.inner.iter)
        }
    }
}
pub use marker_impls::{CharWithBase, Chars, CharsWithBase, Collect, SizedCollect, Usize1};
mod marker_impls {
    use super::*;
    use std::{
        iter::{repeat_with, 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> {
            <usize as IterScan>::scan(iter)?.checked_sub(1)
        }
    }
    #[derive(Debug, Copy, Clone)]
    pub struct CharWithBase(pub char);
    impl MarkedIterScan for CharWithBase {
        type Output = usize;
        #[inline]
        fn mscan<'a, I: Iterator<Item = &'a str>>(self, iter: &mut I) -> Option<Self::Output> {
            Some((<char as IterScan>::scan(iter)? as u8 - self.0 as u8) as usize)
        }
    }
    #[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, B = Vec<<T as IterScan>::Output>>
    where
        T: IterScan,
        B: FromIterator<<T as IterScan>::Output>,
    {
        size: usize,
        _marker: PhantomData<fn() -> (T, B)>,
    }
    impl<T, B> Collect<T, B>
    where
        T: IterScan,
        B: FromIterator<<T as IterScan>::Output>,
    {
        pub fn new(size: usize) -> Self {
            Self {
                size,
                _marker: PhantomData,
            }
        }
    }
    impl<T, B> MarkedIterScan for Collect<T, B>
    where
        T: IterScan,
        B: FromIterator<<T as IterScan>::Output>,
    {
        type Output = B;
        #[inline]
        fn mscan<'a, I: Iterator<Item = &'a str>>(self, iter: &mut I) -> Option<Self::Output> {
            repeat_with(|| <T as IterScan>::scan(iter))
                .take(self.size)
                .collect()
        }
    }
    #[derive(Debug, Copy, Clone)]
    pub struct SizedCollect<T, B = Vec<<T as IterScan>::Output>>
    where
        T: IterScan,
        B: FromIterator<<T as IterScan>::Output>,
    {
        _marker: PhantomData<fn() -> (T, B)>,
    }
    impl<T, B> IterScan for SizedCollect<T, B>
    where
        T: IterScan,
        B: FromIterator<<T as IterScan>::Output>,
    {
        type Output = B;
        #[inline]
        fn scan<'a, I: Iterator<Item = &'a str>>(iter: &mut I) -> Option<Self::Output> {
            let size = usize::scan(iter)?;
            repeat_with(|| <T as IterScan>::scan(iter))
                .take(size)
                .collect()
        }
    }
}
#[macro_export]
macro_rules ! scan_value { ($ scanner : expr , ($ ($ t : tt) ,*)) => { ($ ($ crate :: scan_value ! ($ scanner , $ t)) ,*) } ; ($ scanner : expr , [$ t : tt ; $ len : expr]) => { (0 ..$ len) . map (| _ | $ crate :: scan_value ! ($ scanner , $ t)) . collect ::< Vec < _ >> () } ; ($ scanner : expr , [$ t : ty ; $ len : expr]) => { $ scanner . scan_vec ::<$ t > ($ len) } ; ($ scanner : expr , [$ t : ty]) => { $ scanner . iter ::<$ t > () } ; ($ scanner : expr , { $ e : expr }) => { $ scanner . mscan ($ e) } ; ($ scanner : expr , $ t : ty) => { $ scanner . scan ::<$ t > () } ; }
#[macro_export]
macro_rules ! scan { ($ scanner : expr) => { } ; ($ scanner : expr ,) => { } ; ($ scanner : expr , mut $ var : tt : $ t : tt) => { let mut $ var = $ crate :: scan_value ! ($ scanner , $ t) ; } ; ($ scanner : expr , $ var : tt : $ t : tt) => { let $ var = $ crate :: scan_value ! ($ scanner , $ t) ; } ; ($ scanner : expr , mut $ var : tt : $ t : tt , $ ($ rest : tt) *) => { let mut $ var = $ crate :: scan_value ! ($ scanner , $ t) ; scan ! ($ scanner , $ ($ rest) *) } ; ($ scanner : expr , $ var : tt : $ t : tt , $ ($ rest : tt) *) => { let $ var = $ crate :: scan_value ! ($ scanner , $ t) ; scan ! ($ scanner , $ ($ rest) *) } ; ($ scanner : expr , mut $ var : tt) => { let mut $ var = $ crate :: scan_value ! ($ scanner , usize) ; } ; ($ scanner : expr , $ var : tt) => { let $ var = $ crate :: scan_value ! ($ scanner , usize) ; } ; ($ scanner : expr , mut $ var : tt , $ ($ rest : tt) *) => { let mut $ var = $ crate :: scan_value ! ($ scanner , usize) ; scan ! ($ scanner , $ ($ rest) *) } ; ($ scanner : expr , $ var : tt , $ ($ rest : tt) *) => { let $ var = $ crate :: scan_value ! ($ scanner , usize) ; scan ! ($ scanner , $ ($ rest) *) } ; }
pub mod mint_basic {
    use super::*;
    #[macro_export]
    macro_rules ! define_basic_mintbase { ($ name : ident , $ m : expr , $ basety : ty , $ signedty : 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 p = Self :: get_mod () as $ signedty ; let (mut a , mut b) = (x as $ signedty , p) ; let (mut u , mut x) = (1 , 0) ; while a != 0 { let k = b / a ; x -= k * u ; b -= k * a ; std :: mem :: swap (& mut x , & mut u) ; std :: mem :: swap (& mut b , & mut a) ; } (if x < 0 { x + p } else { x }) as _ } } $ (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 , i32 , 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,
            DYN_MODULUS_U32.with(|cell| unsafe { *cell.get() }),
            DynMIntU32
        ]
    );
    thread_local ! (static DYN_MODULUS_U32 : std :: cell :: UnsafeCell < u32 > = std :: cell :: UnsafeCell :: new (1_000_000_007));
    impl DynModuloU32 {
        pub fn set_mod(m: u32) {
            DYN_MODULUS_U32.with(|cell| unsafe { *cell.get() = m })
        }
    }
    thread_local ! (static DYN_MODULUS_U64 : std :: cell :: UnsafeCell < u64 > = std :: cell :: UnsafeCell :: new (1_000_000_007));
    define_basic_mintbase!(
        DynModuloU64,
        DYN_MODULUS_U64.with(|cell| unsafe { *cell.get() }),
        u64,
        i64,
        u128,
        [u64, u128, usize],
        [i64, i128, isize]
    );
    impl DynModuloU64 {
        pub fn set_mod(m: u64) {
            DYN_MODULUS_U64.with(|cell| unsafe { *cell.get() = 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>;
}
#[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);
}
pub trait Zero: Sized {
    fn zero() -> Self;
    #[inline]
    fn is_zero(&self) -> bool
    where
        Self: PartialEq,
    {
        self == &Self::zero()
    }
    #[inline]
    fn set_zero(&mut self) {
        *self = Self::zero();
    }
}
pub trait One: Sized {
    fn one() -> Self;
    #[inline]
    fn is_one(&self) -> bool
    where
        Self: PartialEq,
    {
        self == &Self::one()
    }
    #[inline]
    fn set_one(&mut self) {
        *self = Self::one();
    }
}
macro_rules ! zero_one_impls { ($ ({ $ Trait : ident $ method : ident $ ($ t : ty) *, $ e : expr }) *) => { $ ($ (impl $ Trait for $ t { 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. });
#[derive(Clone, Debug)]
pub struct PrimeTable {
    table: Vec<u32>,
}
impl PrimeTable {
    pub fn new(max_n: u32) -> Self {
        let mut table = vec![1; (max_n as usize + 1) / 2];
        table[0] = 0;
        for i in (3..).step_by(2) {
            let i2 = i * i;
            if i2 > max_n {
                break;
            }
            if table[i as usize >> 1] == 1 {
                for j in (i2..=max_n).step_by(i as usize * 2) {
                    if table[j as usize >> 1] == 1 {
                        table[j as usize >> 1] = i;
                    }
                }
            }
        }
        PrimeTable { table }
    }
    pub fn is_prime(&self, n: u32) -> bool {
        n == 2 || n % 2 == 1 && self.table[n as usize >> 1] == 1
    }
    pub fn for_each<F>(&self, mut n: u32, mut f: F)
    where
        F: FnMut(u32, u32),
    {
        let k = n.trailing_zeros();
        if k > 0 {
            f(2, k);
        }
        n >>= k;
        while self.table[n as usize >> 1] > 1 {
            let p = self.table[n as usize >> 1];
            let mut cnt = 1;
            n /= p;
            while self.table[n as usize >> 1] == p {
                n /= p;
                cnt += 1;
            }
            if n == p {
                cnt += 1;
                n /= p;
            }
            f(p, cnt);
        }
        if n > 1 {
            f(n, 1);
        }
    }
    pub fn prime_factors(&self, n: u32) -> Vec<(u32, u32)> {
        let mut factors = vec![];
        self.for_each(n, |p, c| factors.push((p, c)));
        factors
    }
    pub fn count_divisors(&self, n: u32) -> u32 {
        let mut divisor_cnt = 1;
        self.for_each(n, |_, cnt| divisor_cnt *= cnt + 1);
        divisor_cnt
    }
}


use std::io;

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

fn solve(tag: String, pat: String) -> bool {

    let mut tag_stm = tag.chars();

    for pat_chr in pat.chars() {
        loop {
            match tag_stm.next() {
                Some(tag_chr) => {
                    if tag_chr == pat_chr {
                        break;
                    }
                }
                None => return false
            }
        }
    }
    true
}

fn main() {
    if solve(read_line().trim().to_string(), "hello".to_string()) {
        println!("YES");
    } else {
        println!("NO");
    }
}


use std::io::{self, BufReader};
use std::io::prelude::*;
use std::collections::HashMap;

fn insert_dist(dist: i32, c: char, dist_map: &mut HashMap<char, i32>, diff: i32) {
    if dist <= (13 + diff) {
        dist_map.insert(c, (dist - diff).abs());
    } else {
        dist_map.insert(c, 26 + diff - dist);
    }
}

fn solve(input: &mut dyn Read, output: &mut dyn Write) {
    let mut reader = BufReader::new(input);
    let mut input = String::new();
    let mut dist_a: HashMap<char, i32> = HashMap::new();
    let mut dist_c: HashMap<char, i32> = HashMap::new();
    let mut dist_t: HashMap<char, i32> = HashMap::new();
    let mut dist_g: HashMap<char, i32> = HashMap::new();

    for (i, c) in "ABCDEFGHIJKLMNOPQRSTUVWXYZ".chars().enumerate() {
        let dist = i as i32;
        insert_dist(dist, c, &mut dist_a, 0);
        insert_dist(dist, c, &mut dist_c, 2);
        if dist <= 6 {
            dist_t.insert(c, 7 + dist);
        } else {
            dist_t.insert(c, (dist - 19).abs());
        }
        insert_dist(dist, c, &mut dist_g, 6);
    }
    // for c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ".chars() {
    //     println!("{} {}", c, dist_t[&c]);
    // }

    reader.read_line(&mut input).unwrap();
    let n: usize = input.trim().parse().unwrap();

    input.clear();
    reader.read_line(&mut input).unwrap();
    let s = input.trim();
    // println!("{:?}", s);

    let char_vec: Vec<char> = s.chars().collect();
    let mut min_sum = -1;
    for i in 0..n-3 {
        let sum = dist_a.get(&char_vec[i]).expect("has values") +
        dist_c.get(&char_vec[i + 1]).expect("has values") +
        dist_t.get(&char_vec[i + 2]).expect("has values") +
        dist_g.get(&char_vec[i + 3]).expect("has values");

        if min_sum == -1 || sum < min_sum {
            min_sum = sum;
        }
    }

    // for c in s.chars() {
    //     println!("{:?}", c);
    // }

    writeln!(output, "{}", min_sum).expect("correct output");

}

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


// ---------- begin Matrix ----------
mod matrix {
    use std::ops::*;
    pub trait SemiRing: Add<Output = Self> + Mul<Output = Self> + Copy {
        fn zero() -> Self;
        fn one() -> Self;
    }
    #[derive(Clone)]
    pub struct SquareMatrix<R> {
        size: usize,
        buf: Box<[R]>,
    }
    #[allow(dead_code)]
    impl<R: SemiRing> SquareMatrix<R> {
        pub fn zero(size: usize) -> Self {
            SquareMatrix {
                size: size,
                buf: vec![R::zero(); size * size].into_boxed_slice(),
            }
        }
        pub fn identity(size: usize) -> Self {
            let mut e = Self::zero(size);
            for i in 0..size {
                e.buf[i * size + i] = R::one();
            }
            e
        }
        pub fn get(&self, x: usize, y: usize) -> &R {
            assert!(x < self.size && y < self.size);
            &self.buf[x * self.size + y]
        }
        pub fn get_mut(&mut self, x: usize, y: usize) -> &mut R {
            assert!(x < self.size && y < self.size);
            &mut self.buf[x * self.size + y]
        }
        pub fn matadd(&self, rhs: &Self) -> Self {
            assert!(self.size == rhs.size);
            let buf: Vec<R> = self
                .buf
                .iter()
                .zip(rhs.buf.iter())
                .map(|p| *p.0 + *p.1)
                .collect();
            SquareMatrix {
                size: self.size,
                buf: buf.into_boxed_slice(),
            }
        }
        pub fn matmul(&self, rhs: &Self) -> Self {
            let size = self.size;
            assert!(size == rhs.size);
            let mut res = Self::zero(size);
            for (x, a) in res.buf.chunks_mut(size).zip(self.buf.chunks(size)) {
                for (a, b) in a.iter().zip(rhs.buf.chunks(size)) {
                    for (x, b) in x.iter_mut().zip(b.iter()) {
                        *x = *x + *a * *b;
                    }
                }
            }
            res
        }
        pub fn mat_pow(&self, mut n: usize) -> Self {
            let size = self.size;
            let mut t = Self::identity(size);
            let mut s = self.clone();
            while n > 0 {
                if n & 1 == 1 {
                    t = t.matmul(&s);
                }
                s = s.matmul(&s);
                n >>= 1;
            }
            t
        }
    }
    #[allow(dead_code)]
    impl<R: SemiRing + Sub<Output = R>> SquareMatrix<R> {
        pub fn matsub(&self, rhs: &Self) -> Self {
            assert!(self.size == rhs.size);
            let buf: Vec<R> = self
                .buf
                .iter()
                .zip(rhs.buf.iter())
                .map(|p| *p.0 - *p.1)
                .collect();
            SquareMatrix {
                size: self.size,
                buf: buf.into_boxed_slice(),
            }
        }
    }
}
// ---------- end Matrix ----------
// ---------- begin ModInt ----------
mod modint {

    #[allow(dead_code)]
    pub struct Mod;
    impl ConstantModulo for Mod {
        const MOD: u32 = 1_000_000_007;
    }

    #[allow(dead_code)]
    pub struct StaticMod;
    static mut STATIC_MOD: u32 = 0;
    impl Modulo for StaticMod {
        fn modulo() -> u32 {
            unsafe { STATIC_MOD }
        }
    }

    #[allow(dead_code)]
    impl StaticMod {
        pub fn set_modulo(p: u32) {
            unsafe {
                STATIC_MOD = p;
            }
        }
    }

    use std::marker::*;
    use std::ops::*;

    pub trait Modulo {
        fn modulo() -> u32;
    }

    pub trait ConstantModulo {
        const MOD: u32;
    }

    impl<T> Modulo for T
    where
        T: ConstantModulo,
    {
        fn modulo() -> u32 {
            T::MOD
        }
    }

    pub struct ModInt<T>(pub u32, PhantomData<T>);

    impl<T> Clone for ModInt<T> {
        fn clone(&self) -> Self {
            ModInt::new_unchecked(self.0)
        }
    }

    impl<T> Copy for ModInt<T> {}

    impl<T: Modulo> Add for ModInt<T> {
        type Output = ModInt<T>;
        fn add(self, rhs: Self) -> Self::Output {
            let mut d = self.0 + rhs.0;
            if d >= T::modulo() {
                d -= T::modulo();
            }
            ModInt::new_unchecked(d)
        }
    }

    impl<T: Modulo> AddAssign for ModInt<T> {
        fn add_assign(&mut self, rhs: Self) {
            *self = *self + rhs;
        }
    }

    impl<T: Modulo> Sub for ModInt<T> {
        type Output = ModInt<T>;
        fn sub(self, rhs: Self) -> Self::Output {
            let mut d = T::modulo() + self.0 - rhs.0;
            if d >= T::modulo() {
                d -= T::modulo();
            }
            ModInt::new_unchecked(d)
        }
    }

    impl<T: Modulo> SubAssign for ModInt<T> {
        fn sub_assign(&mut self, rhs: Self) {
            *self = *self - rhs;
        }
    }

    impl<T: Modulo> Mul for ModInt<T> {
        type Output = ModInt<T>;
        fn mul(self, rhs: Self) -> Self::Output {
            let v = self.0 as u64 * rhs.0 as u64 % T::modulo() as u64;
            ModInt::new_unchecked(v as u32)
        }
    }

    impl<T: Modulo> MulAssign for ModInt<T> {
        fn mul_assign(&mut self, rhs: Self) {
            *self = *self * rhs;
        }
    }

    impl<T: Modulo> Neg for ModInt<T> {
        type Output = ModInt<T>;
        fn neg(self) -> Self::Output {
            if self.0 == 0 {
                Self::zero()
            } else {
                Self::new_unchecked(T::modulo() - self.0)
            }
        }
    }

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

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

    impl<T: Modulo> From<usize> for ModInt<T> {
        fn from(val: usize) -> ModInt<T> {
            ModInt::new_unchecked((val % T::modulo() as usize) as u32)
        }
    }

    impl<T: Modulo> From<u64> for ModInt<T> {
        fn from(val: u64) -> ModInt<T> {
            ModInt::new_unchecked((val % T::modulo() as u64) as u32)
        }
    }

    impl<T: Modulo> From<i64> for ModInt<T> {
        fn from(val: i64) -> ModInt<T> {
            let m = T::modulo() as i64;
            ModInt::new((val % m + m) as u32)
        }
    }

    #[allow(dead_code)]
    impl<T> ModInt<T> {
        pub fn new_unchecked(d: u32) -> Self {
            ModInt(d, PhantomData)
        }
        pub fn zero() -> Self {
            ModInt::new_unchecked(0)
        }
        pub fn one() -> Self {
            ModInt::new_unchecked(1)
        }
        pub fn is_zero(&self) -> bool {
            self.0 == 0
        }
    }

    #[allow(dead_code)]
    impl<T: Modulo> ModInt<T> {
        pub fn new(d: u32) -> Self {
            ModInt::new_unchecked(d % T::modulo())
        }
        pub fn pow(&self, mut n: u64) -> Self {
            let mut t = Self::one();
            let mut s = *self;
            while n > 0 {
                if n & 1 == 1 {
                    t *= s;
                }
                s *= s;
                n >>= 1;
            }
            t
        }
        pub fn inv(&self) -> Self {
            assert!(self.0 != 0);
            self.pow(T::modulo() as u64 - 2)
        }
    }

    #[allow(dead_code)]
    pub fn mod_pow(r: u64, mut n: u64, m: u64) -> u64 {
        let mut t = 1 % m;
        let mut s = r % m;
        while n > 0 {
            if n & 1 == 1 {
                t = t * s % m;
            }
            s = s * s % m;
            n >>= 1;
        }
        t
    }
}
// ---------- end ModInt ----------
// ---------- begin Precalc ----------
mod precalc {
    use super::modint::*;
    #[allow(dead_code)]
    pub struct Precalc<T> {
        inv: Vec<ModInt<T>>,
        fact: Vec<ModInt<T>>,
        ifact: Vec<ModInt<T>>,
    }
    #[allow(dead_code)]
    impl<T: Modulo> Precalc<T> {
        pub fn new(n: usize) -> Precalc<T> {
            let mut inv = vec![ModInt::one(); n + 1];
            let mut fact = vec![ModInt::one(); n + 1];
            let mut ifact = vec![ModInt::one(); n + 1];
            for i in 2..(n + 1) {
                fact[i] = fact[i - 1] * ModInt::new_unchecked(i as u32);
            }
            ifact[n] = fact[n].inv();
            if n > 0 {
                inv[n] = ifact[n] * fact[n - 1];
            }
            for i in (1..n).rev() {
                ifact[i] = ifact[i + 1] * ModInt::new_unchecked((i + 1) as u32);
                inv[i] = ifact[i] * fact[i - 1];
            }
            Precalc {
                inv: inv,
                fact: fact,
                ifact: ifact,
            }
        }
        pub fn inv(&self, n: usize) -> ModInt<T> {
            assert!(n > 0);
            self.inv[n]
        }
        pub fn fact(&self, n: usize) -> ModInt<T> {
            self.fact[n]
        }
        pub fn ifact(&self, n: usize) -> ModInt<T> {
            self.ifact[n]
        }
        pub fn perm(&self, n: usize, k: usize) -> ModInt<T> {
            if k > n {
                return ModInt::zero();
            }
            self.fact[n] * self.ifact[n - k]
        }
        pub fn comb(&self, n: usize, k: usize) -> ModInt<T> {
            if k > n {
                return ModInt::zero();
            }
            self.fact[n] * self.ifact[k] * self.ifact[n - k]
        }
    }
}
// ---------- end Precalc ----------
// ---------- begin input macro ----------
// reference: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, 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 ----------

use modint::*;
type M = ModInt<Mod>;

use matrix::*;
type Mat = SquareMatrix<M>;

impl SemiRing for M {
    fn zero() -> Self {
        M::zero()
    }
    fn one() -> Self {
        M::one()
    }
}

fn run() {
    input! {
        w: [usize; 7],
    }
    // 0: 置いてok
    // 1: おいたらダメ
    let mut mat = vec![];
    for i in 1..=7 {
        let mut m = Mat::zero(1 << i);
        for j in 0..(1 << i) {
            for k in 0..(1 << (2 * i - 1)) {
                if j & k > 0 {
                    continue;
                }
                let mut next = 0;
                for x in 0..i {
                    let left = x == 0 || (k >> (i + x - 1)) & 1 == 1;
                    let down = k >> x & 1 == 1;
                    let right = x == i - 1 || (k >> (i + x)) & 1 == 1;
                    if left && down && right {
                        next |= 1 << x;
                    }
                }
                *m.get_mut(next, j) += M::one();
            }
        }
        mat.push(m);
        let mut m = Mat::zero(1 << i);
        for j in 0..(1 << i) {
            *m.get_mut(j, j) = M::one();
        }
        mat.push(m);
    }
    let mul = |m: &Mat, b: &[M]| -> Vec<M> {
        let mut res = vec![M::zero(); b.len()];
        for i in 0..b.len() {
            for j in 0..b.len() {
                res[i] += *m.get(i, j) * b[j];
            }
        }
        res
    };
    let mut b = vec![M::zero(); 1 << 7];
    let mut ini = false;
    let mut w = w;
    for (i, (w, mat)) in w.iter_mut().zip(mat.chunks(2)).enumerate().rev() {
        if !ini && *w > 0 {
            *w -= 1;
            ini = true;
            let i = i + 1;
            for k in 0..(1 << (i - 1)) {
                let mut bit = 0;
                for x in 0..i {
                    let left = x == 0 || k >> (x - 1) & 1 == 1;
                    let down = true;
                    let right = x == i - 1 || k >> x & 1 == 1;
                    if left && right && down {
                        bit |= 1 << x;
                    }
                }
                b[bit] += M::one();
            }
        }
        b = mul(&mat[1], &b);
        b = mul(&mat[0].mat_pow(*w), &b);
        b.truncate(1 << i);
    }
    let ans = b[0];
    println!("{}", ans);
}

fn main() {
    run();
}


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

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

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

fn read_ts<T : FromStr>(stdin : &Stdin, ts : &mut Vec<T>) {
    let mut line = String::new();
    read_line(stdin, &mut line);
    let word_iter = line.split_whitespace();
    for word in word_iter {
        let x = parse_t(word);
        ts.push(x);
    }
}

fn max_minutes(a : isize, b : isize) -> usize {
    let mut num_minutes = 0;
    let mut m_a = a;
    let mut m_b = b;
    loop {
        if (m_a <= 0) || (m_b <= 0) {
            break;
        } else if (m_a == 1) && (m_b == 1) {
            break;
        } else {
            num_minutes = num_minutes + 1;
            if m_a <= m_b {
                m_a = m_a + 1;
                m_b = m_b - 2;
            } else {
                m_a = m_a - 2;
                m_b = m_b + 1;
            }
        }
    }
    num_minutes
}

fn main() {
    let stdin = io::stdin();
    let mut a_b = vec![];
    read_ts(&stdin, &mut a_b);
    let a = a_b[0];
    let b = a_b[1];
    let result = max_minutes(a, b);
    println!("{}", result);
}


use std::io::stdin;
use std::isize;
fn main() {
    let (x,y) = parse_input();
    let abs_x = x.abs();
    let abs_y = y.abs();
    let a =  abs_x+abs_y;
    if abs_x == x && abs_y == y{
        print(0,a ,a,0)
    }else if abs_x != x && abs_y !=y{
        print(-a,0,0,-a)
    }else if abs_x !=x {
        print(-a,0,0,a)
    }else{
        print(0,-a,a,0)
    }
}
fn parse_input()->(isize,isize){
    let mut input = String::new();
    stdin().read_line(&mut input).unwrap();
    let v:Vec<isize> = input.trim().split_whitespace().map(|e| e.parse().unwrap()).collect();
    (v[0],v[1])
}
fn print(a:isize,b:isize,c:isize,d:isize){
    println!("{} {} {} {}",a,b,c,d)
}


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

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

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

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

fn main() {
    let (a, b): (u64, u64) = {
        let input = get_line();
        let mut it = input.split_whitespace().map(|x| x.parse().unwrap());
        (
            it.next().unwrap(),
            it.next().unwrap(),
            )
    };

    let ans = if b - a < 10 {
        (a..b).fold(1, |acc, k| ((k + 1) * acc) % 10)
    } else {
        0
    };

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


use std::io::Read;

fn input(read_file: bool) -> String {
    if read_file {
        let mut file = std::fs::File::open("sample.txt").unwrap();
        let mut buf = String::new();
        file.read_to_string(&mut buf).unwrap();
        buf
    } else {
        let mut buf = String::new();
        std::io::stdin().read_to_string(&mut buf).unwrap();
        buf.trim_end().to_owned()
    }
}

fn solve(ws: &mut std::str::SplitWhitespace) {
    let s1: Vec<char> = ws.next().unwrap().chars().collect();
    let s2: Vec<char> = ws.next().unwrap().chars().collect();

    let mut p1 = 0;
    for c in s1.iter() {
        if *c == '+' {
            p1 += 1;
        } else {
            p1 -= 1;
        }
    }

    let mut p2 = 0;
    let mut uc = 0;
    for c in s2.iter() {
        match c {
            '+' => p2 += 1,
            '-' => p2 -= 1,
            _ => uc += 1,
        }
    }

    let mut v: Vec<i32> = Vec::new();
    for bit in 0..1 << uc {
        let mut p = p2;
        for i in 0..uc {
            if bit >> i & 1 == 1 {
                p += 1;
            } else {
                p -= 1;
            }
        }
        v.push(p);
    }

    let mut cnt = 0;
    for x in v.iter() {
        if *x == p1 {
            cnt += 1;
        }
    }

    println!("{}", cnt as f64 / v.len() as f64);
}

fn main() {
    const READ_FROM_FILE: bool = false;

    let s = input(READ_FROM_FILE);
    let mut ws = s.split_whitespace();

    solve(&mut ws);
    // let t = ws.next().unwrap().parse().unwrap();
    // for _ in 0..t {}
}


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

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

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

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

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

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

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

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


use std::io;

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

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


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

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

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

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