use std::boxed::Box;
use std::cmp::*;
use std::io;

struct Rand {
    state: u64,
}

impl Rand {
    pub fn new() -> Self {
        Rand { state: 13 }
    }

    pub fn rand(&mut self) -> u64 {
        self.state = ((self.state ^ 1000000007) * 10000009) % 1000000013;
        self.state
    }
}

#[derive(Clone)]
struct Node<T: Ord + Clone> {
    pub key: T,
    pub weight: u64,
    pub left: Option<Box<Node<T>>>,
    pub right: Option<Box<Node<T>>>,
}

impl<T: Ord + Clone> Node<T> {
    fn new(value: T, weight: u64) -> Self {
        Node {
            key: value,
            weight: weight,
            left: None,
            right: None,
        }
    }

    pub fn split(
        node: Option<Box<Node<T>>>,
        key: &T,
    ) -> (Option<Box<Node<T>>>, Option<Box<Node<T>>>) {
        match node {
            None => (None, None),
            Some(mut node) => match node.key.cmp(key) {
                Ordering::Less => {
                    let (l, r) = Self::split(node.right, key);
                    node.right = l;
                    (Some(node), r)
                }
                _ => {
                    let (l, r) = Self::split(node.left, key);
                    node.left = r;
                    (l, Some(node))
                }
            },
        }
    }

    pub fn merge(left: Option<Box<Node<T>>>, right: Option<Box<Node<T>>>) -> Option<Box<Node<T>>> {
        match (left, right) {
            (None, None) => None,
            (left, None) => left,
            (None, right) => right,
            (Some(mut left), Some(mut right)) => match left.weight.cmp(&right.weight) {
                Ordering::Less => {
                    left.right = Self::merge(left.right, Some(right));
                    Some(left)
                }
                _ => {
                    right.left = Self::merge(Some(left), right.left);
                    Some(right)
                }
            },
        }
    }

    fn find(node: &Option<Box<Node<T>>>, key: &T) -> bool {
        match node {
            None => false,
            Some(node) => match node.key.cmp(key) {
                Ordering::Less => Self::find(&node.right, key),
                Ordering::Greater => Self::find(&node.left, key),
                Ordering::Equal => true,
            },
        }
    }

    fn less(node: &Box<Node<T>>) -> T {
        match node.left {
            None => node.key.clone(),
            Some(ref left) => Self::less(left),
        }
    }
}

struct Treap<T: Ord + Clone> {
    root: Option<Box<Node<T>>>,
}

impl<T: Ord + Clone + std::fmt::Display> Treap<T> {
    pub fn insert(&mut self, key: T, weight: u64) {
        let (mut l, r) = Node::split(self.root.take(), &key);
        l = Node::merge(l, Some(Box::new(Node::new(key, weight))));
        self.root = Node::merge(l, r);
    }

    pub fn delete(&mut self, key: &T) {
        let (l, mut r) = Node::split(self.root.take(), key);
        r = match r {
            None => None,
            Some(node) => {
                if &node.key == key {
                    Node::merge(node.left, node.right)
                } else {
                    Some(node)
                }
            }
        };
        self.root = Node::merge(l, r);
    }

    pub fn find(&self, key: &T) -> bool {
        Node::find(&self.root, key)
    }

    pub fn less(&self) -> Option<T> {
        match self.root {
            Some(ref root) => Some(Node::less(root)),
            _ => None,
        }
    }

    pub fn new() -> Self {
        Treap { root: None }
    }
}

fn main() {
    let mut buffer = String::new();
    let mut rand = Rand::new();
    io::stdin().read_line(&mut buffer);
    buffer = String::new();
    io::stdin().read_line(&mut buffer);
    buffer.retain(|s| s != '\r' && s != '\n');
    let a: Vec<u64> = buffer
        .split_whitespace()
        .map(|n| n.parse::<u64>().unwrap())
        .collect();

    buffer = String::new();
    io::stdin().read_line(&mut buffer);
    buffer.retain(|s| s != '\r' && s != '\n');
    let b: Vec<u64> = buffer
        .split_whitespace()
        .map(|n| n.parse::<u64>().unwrap())
        .collect();

    let mut t1 = Treap::new();
    let mut t2 = Treap::new();
    //println!("{:?} | {:?}", &a, &b);
    for n in a {
        t1.insert(n, rand.rand() as u64);
    }
    let mut m3 = 99;
    for n in b {
        t2.insert(n, rand.rand() as u64);
        if t1.find(&n) {
            m3 = std::cmp::min(m3, n);
        }
    }
    let (m1, m2) = (t1.less().unwrap(), t2.less().unwrap());

    if m1 != m2 && m3 < 99 {
        println!("{}", m3);
    } else {
        match m1.cmp(&m2) {
            Ordering::Less => println!("{}{}", m1, m2),
            Ordering::Greater => println!("{}{}", m2, m1),
            Ordering::Equal => println!("{}", m2),
        }
    }
}


use std::io;
use std::io::BufRead;

fn main() {
    let stdin = io::stdin();
    let mut lines = stdin.lock().lines();

    lines.next().unwrap().unwrap();

    let mut first_list = [false; 10];
    let mut second_list = [false; 10];

    lines.next().unwrap().unwrap().split(" ")
        .map(|x| x.parse::<usize>().unwrap())
        .for_each(|x| first_list[x] = true);
    lines.next().unwrap().unwrap().split(" ")
        .map(|x| x.parse::<usize>().unwrap())
        .for_each(|x| second_list[x] = true);

    let mut min_first = 10;
    let mut min_second = 10;

    for i in 1..10 {
        if first_list[i] && second_list[i] {
            println!("{}", i);
            return;
        }
        if first_list[i] && min_first > i {
            min_first = i;
        }
        if second_list[i] && min_second > i {
            min_second = i;
        }
    }

    let result = if min_first > min_second {
        min_second * 10 + min_first
    } else {
        min_first * 10 + min_second
    };

    println!("{}", result);

}


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

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

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

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

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

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

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

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

fn main() {
    let (_n, _m): (usize, usize) = util::get2();
    let a: HashSet<usize> = util::gets().iter().cloned().collect();
    let b: HashSet<usize> = util::gets().iter().cloned().collect();

    for i in 1..100 {
        if i < 10 {
            if a.contains(&i) && b.contains(&i) {
                println!("{}", i);
                return;
            }
        } else {
            if (a.contains(&(i / 10)) || a.contains(&(i % 10))) &&
                (b.contains(&(i / 10)) || b.contains(&(i % 10)))
            {
                println!("{}", i);
                return;
            }
        }
    }
}


use std::io::{self, BufReader, Stdin};
use std::io::prelude::*;
use std::collections::BTreeSet;
use std::iter::Map;
use std::str::SplitWhitespace;

fn main() {
    let mut reader = ReadIn::new();

    reader.read_line();
    let a: BTreeSet<i32> = reader.read_iter().collect();
    let b: BTreeSet<i32> = reader.read_iter().collect();
    let c: BTreeSet<i32> = a.intersection(&b).map(|&x| x).collect();
    let res = (if !c.is_empty() { c.iter().map(|&x| x).next() } else {
        a.iter().next().and_then(
            |&ax| b.iter().next().map(
                |&bx| if (ax < bx) { ax * 10 + bx } else { bx * 10 + ax }))
    }).unwrap();
    print!("{}", res);
}

struct ReadIn { reader: BufReader<Stdin>, buf: String }

impl ReadIn {
    fn new() -> ReadIn { ReadIn { reader: BufReader::new(io::stdin()), buf: String::new() } }
    fn read_i32(s: &str) -> i32 { s.parse().unwrap() }
    fn read_line(&mut self) {
        self.buf.clear();
        self.reader.read_line(&mut self.buf);
    }
    fn read_iter(&mut self) -> Map<SplitWhitespace, fn(&str) -> i32> {
        self.read_line();
        self.buf.split_whitespace().map(ReadIn::read_i32)
    }
    fn read_vec(&mut self) -> Vec<i32> {
        self.read_iter().collect()
    }
}


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

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

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

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

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

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

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

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

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

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

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

impl From<usize> for ModInt {
    fn from(val: usize) -> ModInt {
        ModInt((val % MOD as usize) as u32)
    }
}

#[allow(dead_code)]
impl ModInt {
    pub fn new(n: u32) -> ModInt {
        ModInt(n % MOD)
    }
    pub fn zero() -> ModInt {
        ModInt(0)
    }
    pub fn one() -> ModInt {
        ModInt(1)
    }
    pub fn pow(self, mut n: u32) -> ModInt {
        let mut t = ModInt::one();
        let mut s = self;
        while n > 0 {
            if n & 1 == 1 {
                t *= s;
            }
            s *= s;
            n >>= 1;
        }
        t
    }
    pub fn inv(self) -> ModInt {
        assert!(self.0 > 0);
        self.pow(MOD - 2)
    }
}
// ---------- end ModInt ----------
// ---------- begin Matrix ----------
#[allow(dead_code)]
mod matrix {
    use std::ops::{Add, Mul};
    pub trait SemiRing: Add<Output = Self> + Mul<Output = Self> + Copy {
        fn zero() -> Self;
        fn one() -> Self;
    }
    pub const SIZE: usize = 2;
    #[derive(Clone)]
    pub struct SquareMatrix<T: SemiRing> {
        buf: [[T; SIZE]; SIZE],
    }
    impl<T: SemiRing> SquareMatrix<T> {
        pub fn zero() -> Self {
            let z = T::zero();
            SquareMatrix {
                buf: [[z; SIZE]; SIZE],
            }
        }
        pub fn identity() -> Self {
            let mut m = Self::zero();
            for i in 0..SIZE {
                m.buf[i][i] = T::one();
            }
            m
        }
        pub fn set_at(&mut self, i: usize, j: usize, v: T) {
            self.buf[i][j] = v;
        }
        pub fn get_at(&self, i: usize, j: usize) -> T {
            self.buf[i][j]
        }
        pub fn matmul(&self, rhs: &Self) -> Self {
            let mut res = Self::zero();
            for (x, a) in res.buf.iter_mut().zip(self.buf.iter()) {
                for (a, b) in a.iter().zip(rhs.buf.iter()) {
                    for (x, b) in x.iter_mut().zip(b.iter()) {
                        *x = *x + *a * *b;
                    }
                }
            }
            res
        }
        pub fn matadd(&self, rhs: &Self) -> Self {
            let mut c = Self::zero();
            for (c, (a, b)) in c.buf.iter_mut().zip(self.buf.iter().zip(rhs.buf.iter())) {
                for (c, (a, b)) in c.iter_mut().zip(a.iter().zip(b.iter())) {
                    *c = *a + *b;
                }
            }
            c
        }
        pub fn matpow(&self, mut n: usize) -> Self {
            let mut t = Self::identity();
            let mut s = self.clone();
            while n > 0 {
                if n & 1 == 1 {
                    t = t.matmul(&s);
                }
                s = s.matmul(&s);
                n >>= 1;
            }
            t
        }
    }
}
// ---------- end Matrix ----------

use matrix::*;

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

fn run() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let mut it = s.trim().split_whitespace();
    let a: ModInt = it.next().unwrap().parse().unwrap();
    let b: ModInt = it.next().unwrap().parse().unwrap();
    let mut n: u64 = it.next().unwrap().parse().unwrap();
    let x: ModInt = it.next().unwrap().parse().unwrap();
    type M = SquareMatrix<ModInt>;
    let mut t = M::identity();
    let mut s = M::zero();
    s.set_at(0, 0, a);
    s.set_at(0, 1, b);
    s.set_at(1, 1, ModInt::one());
    while n > 0 {
        if n & 1 == 1 {
            t = t.matmul(&s);
        }
        s = s.matmul(&s);
        n >>= 1;
    }
    let ans = t.get_at(0, 0) * x + t.get_at(0, 1);
    println!("{}", ans);
}

fn main() {
    run();
}


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

const MOD: i128 = 1_000_000_007;

fn modpow(a: i128, b: i128) -> i128 {
    let mut a = a;
    let mut b = b;
    let mut ans = 1;
    while b > 0 {
        if b % 2 != 0 {
            ans = (ans * a) % MOD;
        }
        a = (a * a) % MOD;
        b /= 2;
    }
    ans
}

fn modinv(a: i128) -> i128 {
    modpow(a, MOD - 2) % MOD
}

fn modadd(a: i128, b: i128) -> i128 {
    let mut ans = (a + b) % MOD;
    if ans < 0 {
        ans += MOD;
    }
    ans
}

fn modmult(a: i128, b: i128) -> i128 {
    let mut ans = (a * b) % MOD;
    if ans < 0 {
        ans += MOD;
    }
    ans
}

fn moddiv(a: i128, b: i128) -> i128 {
    (a * modinv(b)) % MOD
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let a: i128 = scan.token();
    let b: i128 = scan.token();
    let n: i128 = scan.token();
    let x: i128 = scan.token();
    let mut ans;
    if n == 0 {
        ans = x % MOD;
    } else if n == 1 {
        ans = modadd(modmult(a, x), b);
    } else if a == 1 {
        ans = modadd(x, modmult(b, n));
    } else {
        ans = modpow(a, n);
        ans = modmult(ans, x);
        let mut quotient = modpow(a, n);
        quotient = modadd(quotient, -1);
        quotient = moddiv(quotient, a - 1);
        let mut part = b % MOD;
        part = modmult(part, quotient);
        ans = modadd(ans, part);
        // ans = ((modpow(a, n) * x) % MOD + ((b * (modpow(a, n) - 1).rem_euclid(MOD)) % MOD * modinv(a - 1)) % MOD) % MOD;
    }
    writeln!(out, "{}", ans).ok();
}

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

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

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

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

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


use std::io;

const M: u64 = 1_000_000_007;

fn mult((a, b): (u64, u64), (c, d): (u64, u64)) -> (u64, u64) {
    ((a*c) % M, (a*d + b) % M)
}

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    let input = input.split_whitespace().map(|s| s.parse().unwrap()).collect::<Vec<u64>>();
    let a = input[0];
    let b = input[1];
    let mut n = input[2];
    let x = input[3];

    let mut g = (1, 0);
    let mut f = (a, b);

    while n != 0 {
        if n % 2 == 1 {
            g = mult(g, f);
        }
        f = mult(f, f);
        n = n / 2;
    }

    let (a, b) = g;
    println!("{}", (a*x + b) % M);
}


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

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

    let a = [2, 5, 8];
    l!(n,k = input.i());
    let sol: i32 = a.into_iter().map(|x| (x * n + k - 1) / k).sum();
    println!("{}", sol);
}


const RED: i32 = 2;
const GREEN: i32 = 5;
const BLUE: i32 = 8;

fn main() {

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

    let friends: i32 = input.next().unwrap().parse().expect("friends: parse to i32 failed");
    let sheets_per_notebook = input.next().unwrap().parse().expect("sheets_per_notebook: parse to i32 failed");

    let outcome = notebooks_amount(friends, sheets_per_notebook);

    println!("{}", &outcome);

}

fn notebooks_amount(friends: i32, sheets_per_notebook: i32) -> i32 {
    let red_notebook_amount = (friends * RED) / sheets_per_notebook
        + if (friends * RED) % sheets_per_notebook != 0 { 1 } else { 0 };
    let green_notebook_amount = friends * GREEN / sheets_per_notebook
        + if (friends * GREEN) % sheets_per_notebook != 0 { 1 } else { 0 };
    let blue_notebook_amount = friends * BLUE / sheets_per_notebook
        + if (friends * BLUE) % sheets_per_notebook != 0 { 1 } else { 0 };

    let total_amount = red_notebook_amount + green_notebook_amount + blue_notebook_amount;

    total_amount
}


fn main() -> std::io::Result<()> {
    let mut contents = String::new();
	std::io::stdin().read_line(&mut contents)?;
	let contents: Vec<&str> = contents.split("\r\n").collect();
	let contents: &str = contents[0];
	let contents: Vec<&str> = contents.split_whitespace().collect();
	let n:u32 = contents[0].parse().unwrap();
	let k:u32 = contents[1].parse().unwrap();
	let mut r = n*2/k;
	if n*2%k!=0{
		r+=1;
	}
	let mut g = n*5/k;
	if n*5%k!=0{
		g+=1;
	}
	let mut b = n*8/k;
	if n*8%k!=0{
		b+=1;
	}
	println!("{}",r+g+b);
	Ok(())
}


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

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

fn div_and_ceil(a: i32, b: i32) -> i32 {
    if a % b == 0 { a / b } else { a / b + 1 }
}

fn main() {
    let (guests, lists) = readln!(i32, i32);

    let red = div_and_ceil(2 * guests, lists);
    let green = div_and_ceil(5 * guests, lists);
    let blue = div_and_ceil(8 * guests, lists);

    println!("{}", red + green + blue);
}


#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (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)*}
    };
}

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

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

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

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

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

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($format:expr) => (write!(out,$format).unwrap());
        ($format:expr, $($args:expr),+) => (write!(out,$format,$($args),*).unwrap())
    }
    input! {
        n: i64,
        k: i64,
    }
    puts!("{}\n", (2 * n + k - 1) / k + (5 * n + k - 1) / k + (8 * n + k - 1) / k);
}

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


// {{{ by shik

use std::io;

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

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

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

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

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

// }}}

use std::cmp;

fn main() {
    let (a, b, c) = R!(u32, u32, u32);
    let ans = cmp::min(cmp::min(2*(a+b), 2*(b+c)), cmp::min(2*(a+c), a+b+c));
    W!(ans);
}


use std::cmp::min;
fn main() {
    let mut reader = scanner::TokenReader::new();
    let (a, b, c) = (
        reader.next::<u32>(),
        reader.next::<u32>(),
        reader.next::<u32>(),
    );

    println!(
        "{}",
        min(a + b + c, min((a + b) * 2, min((b + c) * 2, (a + c) * 2)))
    );
}

// ---------- Begin Scanner ----------
#[allow(dead_code)]
mod scanner {
    use std::fmt::Debug;
    use std::str::FromStr;

    pub struct TokenReader {
        reader: std::io::Stdin,
        tokens: Vec<String>,
        index: usize,
    }

    impl TokenReader {
        pub fn new() -> Self {
            Self {
                reader: std::io::stdin(),
                tokens: Vec::new(),
                index: 0,
            }
        }

        pub fn next<T>(&mut self) -> T
        where
            T: FromStr,
            T::Err: Debug,
        {
            if self.index >= self.tokens.len() {
                self.load_next_line();
            }
            self.index += 1;
            self.tokens[self.index - 1].parse().unwrap()
        }

        pub fn vector<T>(&mut self) -> Vec<T>
        where
            T: FromStr,
            T::Err: Debug,
        {
            if self.index >= self.tokens.len() {
                self.load_next_line();
            }
            self.index = self.tokens.len();
            self.tokens.iter().map(|tok| tok.parse().unwrap()).collect()
        }

        pub fn load_next_line(&mut self) {
            let mut line = String::new();
            self.reader.read_line(&mut line).unwrap();

            self.tokens = line.split_whitespace().map(String::from).collect();
            self.index = 0;
        }
    }
}
// ---------- End Scanner ----------


#![allow(unused_imports)]

use std::mem;
use std::io;
use std::string;
use std::cmp::*;
use std::collections::*;

fn load() -> Vec<i64> {
    let mut line = String::new();
    io::stdin().read_line(&mut line).expect("Failed to read line");
    let vec: Vec<&str> = line.split(" ").collect();
    let mut data: Vec<i64> = Vec::new();
    for i in vec {
        let el: i64 = i.trim().parse().unwrap();
        data.push(el);
    }
    data
}

fn main() {
    let s = load();
    let (a, b, c) = (s[0], s[1], s[2]);
    let mx = max(a, max(b, c));
    let sum = a + b + c;
    println!("{}", min(sum, 2 * (sum - mx)));
}
// min, max
// HashSet, insert, contains
// HashMap, insert, get
// Vec, len, sort
// primitive retype: i as f64


#[allow(unused_imports)]
use std::io;
use std::cmp::{min, max};
pub struct Scanner<B> {
    reader: B,
    buffer: Vec<String>,
}

impl<B: io::BufRead> Scanner<B> {
    pub fn new(reader: B) -> Scanner<B> {
        Scanner {
            reader: reader,
            buffer: Vec::new(),
        }
    }

    /// Use "turbofish" syntax next::<T>() to select data type of next token.
    pub fn next<T: ::std::str::FromStr>(&mut self) -> T
    where
        T::Err: ::std::fmt::Debug,
    {
        if let Some(front) = self.buffer.pop() {
            front.parse::<T>().expect(&front)
        } else {
            let mut input = String::new();
            self.reader.read_line(&mut input).expect("Line not read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
            self.next()
        }
    }

    pub fn next_vec<T: ::std::str::FromStr>(&mut self, len: usize) -> Vec<T>
    where
        T::Err: ::std::fmt::Debug,
    {
        (0..len).map(|_| self.next::<T>()).collect::<Vec<T>>()
    }
}

fn main1() {
    let stdin = io::stdin();
    let mut input = Scanner::new(stdin.lock());
    let d = input.next_vec::<i64>(3);
    println!("{}", min(d[0] + d[1] + d[2], min(2 * (d[0] + d[1]), 2 * min(d[0], d[1]) + 2 * d[2])));
}

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


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

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

    let a = input.i();
    let b = input.i();
    let c = input.i();
    let sol = a.min(b + c) + b.min(a + c) + c.min(a + b);
    println!("{}", sol);
}


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

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

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

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

fn main() {
    let a = readvec!(i32);
    println!("{}",
    min(min(a[0]+a[2]+a[1],
    a[0]*2+a[1]*2),
    min(a[0]*2+a[2]*2,
    a[1]*2+a[2]*2)));
}


use std::io;
use std::cmp;

fn main() {
    "abc".split_whitespace();
    let mut input = String::new();
    io::stdin().read_line(&mut input);
    let mut iter = input.split_whitespace();
    let distance: i64 = iter.next().expect("distance expected").parse().expect("integer distance expected");
    let km_per_stop: i64 = iter.next().expect("km_per_stop expected").parse().expect("integer km_per_stop expected");
    let car_km_time: i64 = iter.next().expect("car_km_time expected").parse().expect("car_km_time distance expected");
    let walk_km_time: i64 = iter.next().expect("walk_km_time expected").parse().expect("walk_km_time distance expected");
    let repair_time: i64 = iter.next().expect("repair_time expected").parse().expect("repair_time distance expected");

    let trip_time;
    let car_cost : i64 = car_km_time * km_per_stop - walk_km_time * km_per_stop + repair_time;
    if car_cost >= 0 || km_per_stop >= distance {
        let car_dist = cmp::min(km_per_stop, distance);
        let walk_dist = distance - car_dist;
        trip_time = car_dist * car_km_time + walk_dist * walk_km_time;
    } else {
        let full_stops = distance / km_per_stop;
        let distance_cost = full_stops * km_per_stop * car_km_time;
        let repair_cost = (full_stops - 1) * repair_time;
        let full_stops_cost = distance_cost + repair_cost;

        let remaining_dist = distance % km_per_stop;
        let remaining_walk = remaining_dist * walk_km_time;
        let remaining_car = remaining_dist * car_km_time + repair_time;
        let remaining_cost = cmp::min(remaining_walk, remaining_car);

        trip_time = full_stops_cost + remaining_cost;
    }
    println!("{}", trip_time);

}


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

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

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

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

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

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

/// Stores elements in row-major order.
pub struct Matrix<T> {
  pub elements: Vec<T>,
  pub width: usize
}

impl<T> Matrix<T> {
  pub fn row_major_index(&self, idx: (usize, usize)) -> usize {
    let (x, y) = idx;
    y * self.width + x
  }

  pub fn get(&self, idx: (usize, usize)) -> Option<&T> {
    let index = self.row_major_index(idx);
    if index < self.elements.len() {
      Some(&self.elements[index])
    } else {
      None
    }
  }

  pub fn get_mut(&mut self, idx: (usize, usize)) -> Option<&mut T> {
    let index = self.row_major_index(idx);
    if index < self.elements.len() {
      Some(&mut self.elements[index])
    } else {
      None
    }
  }
}

impl<T> Matrix<T> where T: Default + Clone {
  pub fn new(width: usize, height: usize) -> Self {
    Matrix {
      elements: vec![T::default(); width * height],
      width: width
    }
  }
}

impl<T> Matrix<T> where T: Clone {
  pub fn with_default(width: usize, height: usize, default: T) -> Self {
    Matrix {
      elements: vec![default; width * height],
      width: width
    }
  }
}

const __IMPL_INDEX_FOR_MATRIX: () = {
  use std::ops::{Index, IndexMut};

  impl<T> Index<(usize, usize)> for Matrix<T> {
    type Output = T;
    fn index(&self, idx: (usize, usize)) -> &Self::Output {
      self.get(idx).unwrap()
    }
  }

  impl<T> IndexMut<(usize, usize)> for Matrix<T> {
    fn index_mut(&mut self, idx: (usize, usize)) -> &mut Self::Output {
      self.get_mut(idx).unwrap()
    }
  }
};

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

fn main() {
  let mut square = Matrix::new(4, 4);
  for j in 0..4 {
    scanln!(row: String);
    for (i, &b) in row.as_bytes().iter().enumerate() {
      square[(i, j)] = if b == b'#' { 1u64 } else { 0u64 };
    }
  }
  for i in 0..3 {
    for j in 0..3 {
      let sum = square[(i, j)] + square[(i+1, j)]
        + square[(i, j+1)] + square[(i+1, j+1)];
      match sum {
        0 | 1 | 3 | 4 => {
          println!("YES");
          return;
        },
        _ => ()
      }
    }
  }
  println!("NO");
}


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

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

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

}

fn _main() {
    let mut scan = Scan::new();
    let n: usize = scan.next();
    let k: usize = scan.next();
    let l: usize = scan.next();
    let c: usize = scan.next();
    let d: usize = scan.next();
    let p: usize = scan.next();
    let nl: usize = scan.next();
    let np: usize = scan.next();
    let l_person = l*k/nl;
    let c_person = c*d;
    let p_person = p/np;
    let result = l_person.min(c_person).min(p_person)/n;
    println!("{}", result);
}

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


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

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

    let a = input.vp::<i32>(8);
    let sol = (a[1] * a[2] / a[6]).min(a[3] * a[4]).min(a[5] / a[7]) / a[0];
    println!("{}", sol);
}


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

fn get_nums() -> (i32, i32, i32, i32, i32, i32, i32, i32) {
	let mut input = String::new();

	io::stdin().read_line(&mut input)
		.expect("");

	let v = input.trim()
			.split_whitespace()
			.map(|d| i32::from_str(d).unwrap())
			.collect::<Vec<_>>();

	(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7])
}

fn main() {
	let (n, k, l, c, d, p, nl, np) = get_nums();

	println!("{}", min((k*l)/nl, c*d, p/np)/n);

	fn min(x: i32, y: i32, z: i32) -> i32 {
		if x < y {
			if x < z {
				x
			} else {
				z
			}
		} else if y < z {
			y
		} else {
			z
		}
	}
}


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

enum Protocol { HTTP, FTP }

fn fix_protocol(s: &String) -> (String, Protocol) {
    let mut res: String = String::new();
    if s.chars().nth(0) == Some('f') {
        (s.chars().skip(3).collect(), Protocol::FTP)
    } else {
        (s.chars().skip(4).collect(), Protocol::HTTP)
    }
}

fn main() {
    let mut s = read_line();
    let (s_skip_proto, protocol) = fix_protocol(&s);
    let mut s_res = s_skip_proto.clone();
    let s_res_skipped: String = s_skip_proto.chars().skip(1).collect();

    // res = String::from("http://");
    // let appendix: String = s.chars().skip(4).collect();
    // res.push_str(&appendix);

    // println!("{}", s_skip_proto);

    match s_res_skipped.find("ru") {
        Some(i) => {
            s_res.insert(i + 1, '.');
            if i + 4 < s_res.len() {
                // println!("------------- {}", i + 5);
                s_res.insert(i + 4, '/');
            }
        },
        _ => panic!("no ruurururur")
    }

    let mut s_res_res = match protocol {
        Protocol::HTTP => String::from("http://"),
        _ => String::from("ftp://")
    };
    s_res_res.push_str(&s_res);

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


// ---------- begin chmin, chmax ----------
trait ChangeMinMax {
    fn chmin(&mut self, x: Self) -> bool;
    fn chmax(&mut self, x: Self) -> bool;
}

impl<T: PartialOrd> ChangeMinMax for T {
    fn chmin(&mut self, x: Self) -> bool {
        *self > x && {
            *self = x;
            true
        }
    }
    fn chmax(&mut self, x: Self) -> bool {
        *self < x && {
            *self = x;
            true
        }
    }
}
// ---------- end chmin, chmax ----------
//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")
    };
}

//

use std::cmp::*;

fn run() {
    input! {
        n: usize,
        s: chars,
    }
    let s: Vec<usize> = s.into_iter().map(|c| {
        match c {
            'V' => 0,
            'K' => 1,
            _ => 2,
        }
    }).collect();
    let mut cnt = [0; 3];
    for k in s.iter() {
        cnt[*k] += 1;
    }
    let inf = n * (n + 1) / 2 + 1;
    // [末尾がV][使ったVの数][使ったKの数][使ったそれ以外]
    let mut dp = vec![vec![vec![vec![inf; cnt[2] + 1]; cnt[1] + 1]; cnt[0] + 1]; 2];
    dp[0][0][0][0] = 0;
    for v in 0..=cnt[0] {
        for k in 0..=cnt[1] {
            for a in 0..=cnt[2] {
                let x = dp[0][v][k][a];
                let y = dp[1][v][k][a];
                let z = [v, k, a];
                let count = |p: usize| -> usize {
                    let mut val = [0; 3];
                    let mut ans = 0;
                    for &q in s.iter() {
                        val[q] += 1;
                        if q == p && val[q] > z[p] {
                            break;
                        }
                        if val[q] > z[q] {
                            ans += 1;
                        }
                    }
                    ans
                };
                if v + 1 <= cnt[0] {
                    let val = min(x, y) + count(0);
                    dp[1][v + 1][k][a].chmin(val);
                }
                if k + 1 <= cnt[1] {
                    let val = x + count(1);
                    dp[0][v][k + 1][a].chmin(val);
                }
                if a + 1 <= cnt[2] {
                    let val = min(x, y) + count(2);
                    dp[0][v][k][a + 1].chmin(val);
                }
            }
        }
    }
    let (v, k, a) = (cnt[0], cnt[1], cnt[2]);
    let ans = min(dp[0][v][k][a], dp[1][v][k][a]);
    println!("{}", ans);
}

fn main() {
    run();
}


#[allow(unused_imports)]
use std::cmp;
use std::fs::File;
use std::io::Read;

#[allow(dead_code)]
fn pow_speedy_with_mod(mut p: i64, mut q: i64, m: i64) -> i64 {
    p %= m;
    let mut r = p;
    let mut ret: i64 = 1;
    while q > 0 {
        ret *= if q % 2 == 1 { r } else { 1 };
        r *= r;
        r %= m;
        q /= 2;
        ret %= m;
    }
    return ret;
}

#[allow(dead_code)]
fn comb(n: usize, k: usize, m: i64, frac: &[i64], frac_inv: &[i64]) -> i64 {
    let mut ret = 1i64;
    if n < k {
        return 0;
    }
    ret *= frac[n] * frac_inv[n - k];
    ret %= m;
    ret *= frac_inv[k];
    ret %= m;
    ret
}

fn main() {
    let inputstatus = 1;

    let mut buf = String::new();
    let filename = "inputrust.txt";

    if inputstatus == 0 {
        let mut f = File::open(filename).expect("file not found");
        f.read_to_string(&mut buf)
            .expect("something went wrong reading the file");
    } else {
        std::io::stdin().read_to_string(&mut buf).unwrap();
    }

    let mut iter = buf.split_whitespace();

    let a: i64 = iter.next().unwrap().parse().unwrap();
    let mut b: i64 = iter.next().unwrap().parse().unwrap();
    let mut ans: i64 = 0;
    for i in 0..b + 1 {
        let x = a * i;
        ans = cmp::max(ans, (x + b) * (x + 1) * (b + 1) / 2);
        b -= 1;
    }
    println!("{}", ans);
    // let n = iter.next().unwrap().parse().unwrap();

    // println!("{}", n);
    // println!("{:?}", cum_num);
}


//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!(t,s,x = input.i());
    if x >= t && x != t + 1 && (x - t) % s <= 1 {
        println!("YES");
    } else {
        println!("NO");
    }
}


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

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

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

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

fn _main() {
    let mut scan = Scan::new();
    let x: isize = scan.next();
    let y: isize = scan.next();
    let val = x.abs() + y.abs();
    let first = (0, val * y.signum());
    let second = (val * x.signum(), 0);
    let min = first.min(second);
    let max = first.max(second);
    println!("{} {} {} {}", min.0, min.1, max.0, max.1);
}

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


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

    let f0 = b"What are you doing at the end of the world? Are you busy? Will you save us?";
    let f1a = b"What are you doing while sending \"";
    let f1b = b"\"? Are you busy? Will you send \"";
    let f1c = b"\"?";

    let mut w = vec![0_u64; 100001];

    w[0] = f0.len() as u64;
    for i in 1..w.len() {
        w[i] = w[i-1] * 2 + (f1a.len() + f1b.len() + f1c.len()) as u64;
    }

    let q = get!();
    let mut v = vec![];
    for _ in 0..q {
        let mut n: usize = get!();
        let mut k: u64 = get!();
        k -= 1;
        loop {
            if k > w[n] {
                v.push(b'.');
                break;
            } else if n == 0 {
                v.push(f0[k as usize]);
                break;
            } else {
                n -= 1;
                if k < f1a.len() as u64 {
                    v.push(f1a[k as usize]);
                    break;
                }
                k -= f1a.len() as u64;
                if k < w[n] {
                    continue;
                }
                k -= w[n];
                if k < f1b.len() as u64 {
                    v.push(f1b[k as usize]);
                    break;
                }
                k -= f1b.len() as u64;
                if k < w[n] {
                    continue;
                }
                k -= w[n];
                if k < f1c.len() as u64 {
                    v.push(f1c[k as usize]);
                    break;
                }
                v.push(b'.');
                break;
            }
        }
    }
    println!("{}", String::from_utf8(v).unwrap());
}


use std::io;

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input).expect("failed to read input");
    let mut input_iter = input.split_whitespace();
    let a = input_iter.next().unwrap();
    let b = input_iter.next().unwrap();
    if a == b {
        println!("{}", a);
    } else {
        println!("1");
    }
}


// Try Codeforces
// author: Leonardone @ NEETSDKASU

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

    let n = get!() + 1;
    let ans;
    if n == 1 {
        ans = 0;
    } else if n % 2 == 0 {
        ans = n / 2;
    } else {
        ans = n;
    }

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


use std::io::*;

fn is_vowel(c: char) -> bool {
    match c {
        'a' | 'e' | 'i' | 'o'| 'u' | 'y' => {
            true
        },
        _ => false
    }
}

fn main () {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.clear();
    stdin().read_line(&mut buf).unwrap();
    let s = buf.trim();
    let mut res = Vec::<char>::new();
    let mut second_vowel = false;
    for c in s.chars() {
        if is_vowel(c) {
            if !second_vowel {
                second_vowel = true;
                res.push(c);
            }
        } else {
            res.push(c);
            second_vowel = false;
        }
    }
    println!("{}", res.into_iter().collect::<String>());
}


#[allow(unused_imports)]
use std::io::{stdin, Read, StdinLock};
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::{HashSet, HashMap, BinaryHeap, VecDeque};
#[allow(unused_imports)]
use std::vec::Vec;

#[allow(dead_code)]
const INF: i32 = 1000_000_000;
#[allow(dead_code)]
const INFLL: i64 = 1000_000_000_000_000_000;
#[allow(dead_code)]
const EPS: f64 = 1.0e-10;
#[allow(dead_code)]
const MOD: i32 = 1000_000_007;
#[allow(dead_code)]
const MODLL: i64 = 1000_000_007;

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner {cin: cin}
    }
    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
                    .skip_while(|c| c.is_whitespace())
                    .take_while(|c| !c.is_whitespace())
                    .collect::<String>();
        token.parse::<T>().ok()
    }
    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let _n: usize = sc.read();
    let s: String = sc.read();
    let s: Vec<char> = s.chars().collect();

    fn vowel(c: char) -> bool {
        return c == 'a' || c == 'i' || c == 'e' || c == 'o' || c == 'u' || c == 'y';
    }

    let mut ans: String = String::new();
    let mut last = '0';
    for c in s {
        if ans.len() == 0 {
            ans.push(c);
            last = c;
        } else {
            if vowel(last) && vowel(c) {
                continue;
            }
            ans.push(c);
            last = c;
        }
    }
    println!("{}", ans);
}


use std::io::stdin;
fn main(){
    let mut s:String=String::new();
    stdin().read_line(&mut s).unwrap();
    s.clear();
    stdin().read_line(&mut s).unwrap();
    s.trim();
    let b="aeyuio";
    let mut c:usize=1;
    let mut p:i32=0;
    let mut l:i32=0;
    while c<s.len(){
        match s.chars().nth(c).unwrap(){
            'a'=>p=1,
            'e'=>p=1,
            'y'=>p=1,
            'u'=>p=1,
            'i'=>p=1,
            'o'=>p=1,
            _=>p=0,
        }
        match s.chars().nth(c-1).unwrap(){
            'a'=>l=1,
            'e'=>l=1,
            'y'=>l=1,
            'u'=>l=1,
            'i'=>l=1,
            'o'=>l=1,
            _=>l=2,
        }
        if p==l{
            s.remove(c);
        }
        else{c+=1;}
    }
    println!("{}",s);
}


use std::io::stdin;
fn main() {
    let mut text = String::new();
    stdin().read_line(&mut text).unwrap();
    let text = text.trim();
    let mut counter4: usize = 0;
    let mut counter7: usize = 0;
    for i in text.chars() {
        if '4' == i {
            counter4 += 1;
        } else if '7' == i {
            counter7 += 1;
        }
    }
    if counter4 == 0 && counter7 == 0 {
        println!("-1");
    } else if counter4 >= counter7 {
        println!("4")
    } else {
        println!("7")
    }
}

fn delete_leading_zeroes(arr: Vec<char>) -> Vec<char> {
    let mut finded = false;
    let mut last = 0;
    for i in 0..arr.len() {
        if '0' == arr[i] {
            continue;
        } else {
            last = i;
            finded = true;
            break;
        }
    }
    if finded {
        arr[last..].to_vec()
    } else {
        arr
    }
}


#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stderr, stdin, stdout, BufWriter, StdoutLock, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_imports)]
use std::{i64, u64, usize};
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; ( $ next : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , [ $ 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" ) } ; }
#[allow(dead_code)]
struct Writer {
    s: String,
}
#[allow(unused_imports)]
use std::fmt::Display;
#[allow(dead_code)]
#[doc = " let mut writer = Writer::new();"]
#[doc = " writer.writeln(hoge);"]
#[doc = " writer.flush()"]
impl Writer {
    #[allow(dead_code)]
    pub fn new() -> Writer {
        Writer { s: String::new() }
    }
    #[allow(dead_code)]
    pub fn flush(&mut self) {
        print!("{}", self.s);
        self.s.clear();
    }
    pub fn write<T: Display>(&mut self, x: T) {
        self.s.push_str(&format!("{}", x));
    }
    pub fn writeln<T: Display>(&mut self, x: T) {
        self.s.push_str(&format!("{}", x));
        self.s.push('\n');
    }
    #[allow(dead_code)]
    pub fn write_vec<T: Display>(&mut self, xs: &Vec<T>) {
        if xs.len() == 0 {
            self.writeln("");
            return;
        }
        self.write(&format!("{}", xs[0]));
        for i in 1..xs.len() {
            self.write(&format!(" {}", xs[i]));
        }
        self.writeln("");
    }
}
#[allow(unused_macros)]
macro_rules ! dbg { ( $ ( $ a : expr ) ,* ) => { writeln ! ( & mut stderr ( ) , concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) . unwrap ( ) ; } }
#[allow(dead_code)]
const INF_U: u64 = 1_000_000_000_000_000;
#[allow(dead_code)]
const INF_I: i64 = 1_000_000_000_000_000;
#[allow(non_snake_case)]
#[allow(dead_code)]
fn main() {
    input! {
        n: usize,
        a: [usize; n]
    }
    let mut ans = 0;
    let mut flag = false;
    for i in 1..n {
        dbg!(ans);
        if a[i-1] == 1 {
            if a[i] == 2 {
                if flag { ans += 2; }
                else { ans += 3; }
            } else {
                ans += 4;
            }
        } else if a[i-1] == 2 {
            if a[i] == 1 {
                ans += 3;
            } else {
                println!("Infinite");
                return;
            }
        } else {
            if a[i] == 1 {
                ans += 4;
                flag = true;
                continue;
            } else {
                println!("Infinite");
                return;
            }
        }
        flag = false;
    }
    println!("Finite");
    println!("{}", ans);
}


#[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 ] } ; }
#[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:[usize;n]
    }
    let mut tot = 0;
    for i in 1..n {
        let x = i-1;
        let y = i;
        match (a[x],a[y]) {
            (1,2) | (2,1) => {
                if tot != -1 {
                    tot += 3
                }
            },
            (2,3) | (3,2) => {
                tot = -1
            },
            (1,3) | (3,1) => {
                if tot != -1 {
                    tot += 4
                }
            },
            _ => {

            }
        }
    }
    if tot == -1 {
        writeln!(out,"Infinite");
        return
    }
    for i in 2..n {
        match (a[i-2],a[i-1],a[i]) {
            (3,1,2) => {
                tot -= 1;
            },
            _ => {}
        }
    }
    writeln!(out,"Finite");
    writeln!(out,"{}",tot);
}


// https://codeforces.com/contest/1156/problem/A
//
#![allow(unused_imports)]
use std::io::*;
use std::io::Write;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

// Input macros.
// Original by tanakh: https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
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)*}
    };
}

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

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

#[allow(unused_macros)]
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, [ next / $t:tt ]) => {
        {
            let len = read_value!($iter, usize);
            (0..len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, switch) => {
        {
            let ty = read_value!($iter, i32);
            if ty == 1 {
                vec![ty, read_value!($iter, i32), read_value!($iter, i32)]
            } else if ty == 2 {
                vec![ty, read_value!($iter, i32)]
            } else {
                vec![ty, read_value!($iter, i32)]
            }
        }
    };

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

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

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

#[allow(unused_macros)]
macro_rules! read_line {
    ($t:tt) => {
        {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).unwrap();
            s.trim_right().parse::<$t>().unwrap()
        }
    }
}

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! ifv {
    ($t:expr, $a:expr, $b: expr) => {
        if $t { $a } else { $b }
    }
}

#[allow(unused_macros)]
macro_rules! fill {
    ($t:expr, $v:expr) => {
        for i in 0..$t.len() {
            $t[i] = $v;
        }
    };
}

#[allow(unused_macros)]
macro_rules! join {
    ($t:expr, $glue:expr) => {
        $t.into_iter().map(|w| w.to_string()).collect::<Vec<_>>().join($glue)
    };
}

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

// ===

fn main() {
    input! {
        n: usize,
        a: [usize1; n]
    };

    let INF = 1000000000i64;
    let table = vec![
        vec![-INF, 3, 4],
        vec![3, -INF, -INF],
        vec![4, -INF, -INF],
    ];

    let mut points = 0i64;
    for i in 1..n {
        points += table[a[i-1]][a[i]];
        if i >= 2 && a[i-2] == 2 && a[i-1] == 0 && a[i] == 1 {
            points -= 1;
        }
    }
    if points <= -1 {
        println!("Infinite");
    } else {
        println!("Finite");
        println!("{}", points);
    }
}


#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

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

#[allow(unused_imports)]
use std::io::Write;
type I = usize;

fn main() {
    input!{
      n: usize,
      aa: [usize; n],
    }

    let mut ans: u64 = 0;
    for i in 1..n {
         let a1 = aa[i-1];
         let a2 = aa[i];
         let mut a = [a1, a2];
         a.sort();

         if a[0] != 1 {
             return println!("{}", "Infinite");
         }

         if a[1] == 2 {
            if a2 == 2 && i>=2 && aa[i-2] == 3 {
                ans += 2;
            } else {
                ans += 3;
            }
         } else {
            ans += 4;
         }
    }
    println!("{}", "Finite");
    println!("{}", ans);
}


#![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 _n = read_usize();
    let v = read_multiple::<u8>();
    let mut points = 0;
    let mut prev2 = 0;
    let mut prev = v[0];
    for a in v.into_iter().skip(1) {
        if prev == 1 {
            if a == 2 {
                points += 3
            } else {
                points += 4;
            }
        } else if prev == 2 {
            if a == 1 {
                points += 3
            } else {
                println!("Infinite");
                return Ok(());
            }
        } else {
            //prv == 3
            if a == 1 {
                points += 4
            } else {
                println!("Infinite");
                return Ok(());
            }
        }
        if prev2 == 3 && prev == 1 && a == 2 {
            points -= 1;
        }
        prev2 = prev;
        prev = a;
    }
    println!("Finite");
    println!("{}", points);
    Ok(())
}


use std::io;

fn main() {
    let mut a_str = String::new();
    io::stdin().read_line(&mut a_str).expect("read error");
    let mut numbers = a_str.split_whitespace()
        .map(|x| x.parse::<i32>().expect("parse error"))
        .collect::<Vec<i32>>();
    let n = numbers[0];
    let pos = numbers[1];
    let l = numbers[2];
    let r = numbers[3];

    let mut res = 0;

    if l != 1 && r == n {
        res += (pos - l).abs() + 1;
    } else if r != n && l == 1 {
        res += (r - pos).abs() + 1;
    } else if r == n && l == 1{
        res = 0;
    } else {
        if (pos - l).abs() < (r - pos).abs() {
            if l != r {
                res += r - l + (pos - l).abs() + 2;
            } else {
                res += (pos - l).abs() + 2;
            }
        } else {
            if l != r {
                res += r - l + (r - pos).abs() + 2;
            } else {
                res += (r - pos).abs() + 2;
            }
        }
    }
    println!("{}", res);
}


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

fn main() {
    let (n, pos, l, r) = get!(isize, isize, isize, isize);

    if l == 1 && r == n {
        println!("{}", 0);
        return;
    }

    if l == 1 {
        println!("{}", (r - pos).abs() + 1);
        return;
    }

    if r == n {
        println!("{}", (l - pos).abs() + 1);
        return;
    }

    let ans1 = (l - pos).abs() + 1 + (r - l).abs() + 1;
    let ans2 = (r - pos).abs() + 1 + (r - l).abs() + 1;

    println!("{}", min(ans1, ans2));
}


use std::io::stdin;
use std::cmp::min;

fn main() {
    let mut input = String::new();
    stdin().read_line(&mut input).unwrap();
    let nposlr = input.split_whitespace().map(|x| x.parse::<i32>().unwrap()).collect::<Vec<_>>();
    let (n, pos, l, r) = (nposlr[0], nposlr[1], nposlr[2], nposlr[3]);

    if l == 1 && r == n {
        println!("0");
    } else if l == 1 {
        println!("{}", (pos - r).abs() + 1);
    } else if r == n {
        println!("{}", (pos - l).abs() + 1);
    } else {
        let min_dist = min((pos - l).abs(), (pos - r).abs());
        println!("{}", min_dist + (r - l).abs() + 2);
    }

}


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

fn get_num() -> usize {
    let mut input = String::new();

    io::stdin().read_line(&mut input).expect("");

    usize::from_str(input.trim()).unwrap()
}

fn get_string() -> String {
    let mut input = String::new();

    io::stdin().read_line(&mut input).expect("");

    input.trim().to_string()
}

fn main() {
    let n = get_num();

    let mut v = vec![0; 10];
    for _ in 0..4 {
        let s = get_string();

        for c in s.chars() {
            if c == '.' {
                continue;
            }
            v[c.to_digit(10).unwrap() as usize] += 1;
        }
    }

    let mx = v.iter().max().unwrap();

    if *mx > 2 * n {
        println!("NO");
    } else {
        println!("YES");
    }
}


fn read()->Vec<i32>{
    let mut line=String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.split_whitespace().map(|x|x.parse::<i32>().unwrap()).collect()
}
use std::i32;
fn main(){
    let vec=read();
    let stairs=i32::abs(vec[0]-vec[1])*vec[3];
    let lift=i32::abs(vec[0]-vec[1])*vec[4]+3*vec[5]+i32::abs(vec[0]-vec[2])*vec[4];
    if lift<=stairs{
        println!("YES");
    }
    else{
        println!("NO");
    }
}


use std::io;

fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    let mut s = s.split_whitespace();
    let x: i32 = s.next().unwrap().parse().unwrap();
    let y: i32 = s.next().unwrap().parse().unwrap();
    let z: i32 = s.next().unwrap().parse().unwrap();
    let t1: i32 = s.next().unwrap().parse().unwrap();
    let t2: i32 = s.next().unwrap().parse().unwrap();
    let t3: i32 = s.next().unwrap().parse().unwrap();
    if (x - y).abs() * t1 < ((x - z).abs() + (x - y).abs()) * t2 + 3 * t3 {
        println!("NO");
    } else {
        println!("YES");
    }
}