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

#[allow(unused_macros)]
macro_rules! readln {
    () => {{
        use std::io;

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

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

fn main() {
  let (n,a,mut b) = readln!(i32,i32,i32);
  if b < 0 {
    b = -b;
    b %= n;
    b = (n-b)%n;
  }
  println!("{}",1+((a-1+b)%n));
}

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

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

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

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

    let n = input.i();
    let a = input.i();
    let b = input.i();
    println!("{}", ((a - 1 + b) % n + n) % n + 1);
}


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

fn main() {
    let mut l = String::new();
    std::io::stdin().read_line(&mut l).unwrap();
    let mut mb = l.split_whitespace().map(|s| s.parse::<u64>().unwrap());
    let m = mb.next().unwrap();
    let b = mb.next().unwrap();

    let answer: u64 = (0..(b+1)).into_iter().map(|height| {
        let width = m * (b - height);

        let height_sum = height * (height+1) / 2;
        let width_sum = width * (width+1) / 2;

        height_sum * (width+1) + width_sum * (height+1)
    }).max().unwrap();
    println!("{}", answer);
}

use std::io::stdin;

fn main() {
    let mut input = String::new();
    stdin().read_line(&mut input).unwrap();
    let mut input = input.split_whitespace().map(|k| k.parse::<u64>().unwrap());
    let m = input.next().unwrap();
    let b = input.next().unwrap();

    let ans = (0..(m * b + 1)).map(|x| {
        let y = b - (x + m - 1) / m;
        let tmp = (x + 1) * (y + 1) * (x + y) / 2 ;
        tmp
    }).max().unwrap();

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

use std::io::stdin;

fn main() {
    let mut input = String::new();
    stdin().read_line(&mut input).unwrap();
    let mut input = input.split_whitespace().map(|k| k.parse::<u32>().unwrap());
    let m = input.next().unwrap();
    let b = input.next().unwrap();

    let ans = (0..(m * b + 1)).map(|x| {
        let y = b - (x + m - 1) / m;
        (x + 1) * (y + 1) / 2 * (x + y)
    }).max().unwrap();

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

use std::io::stdin;

fn main() {
    let mut input = String::new();
    stdin().read_line(&mut input).unwrap();
    let mut input = input.split_whitespace().map(|k| k.parse::<u32>().unwrap());
    let m = input.next().unwrap();
    let b = input.next().unwrap();

    let ans = (0..(m * b + 1)).map(|x| {
        let y = b - (x + m - 1) / m;
        let tmp = (x + 1) * (y + 1) * (x + y) / 2 ;
        tmp
    }).max().unwrap();

    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 mut n = parse_line!(u64);
    let mut result = 0;
    let mut add = 1;
    while n > 1 {
        result += n / 2 * add;
        add *= 2;
        n = (n + 1) / 2;
    }
    println!("{}", result);
}

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

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

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

    let bc = n.next_power_of_two().trailing_zeros();

    let mut cb = 1;
    let mut ans = 0;
    for _ in 0..bc {
        let t = cb * ((n - 1 + cb) / (cb << 1));
        ans += t;
        cb <<= 1;
    }

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


use std::io;

macro_rules! parse_line {
    ($($t: ty),+) => ({
        let mut a_str = String::new();
        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"),
            )+
        )
    })
}

fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    let s = s.trim().as_bytes();
    let (k,) = parse_line!(i32);
    let (mut min_l, mut max_l) = (0, 0);
    for c in s.iter() {
        if c==&b'?' || c==&b'*' {
            min_l -= 1;
        } else {
            min_l += 1;
            max_l += 1;
        }
    }
    if k < min_l || (k > max_l && !s.contains(&b'*')) {
        println!("Impossible");
    } else {
        let mut r = Vec::new();
        let mut d = k - min_l;
        let l = s.len();
        for i in 0..l {
            if i+1 < l && s[i+1] == b'?' {
                if d > 0 {
                    r.push(s[i]);
                    d -= 1;
                }
            } else if i+1 < l && s[i+1] == b'*' {
                while d > 0 {
                    r.push(s[i]);
                    d -= 1;
                }
            } else if s[i] != b'?' && s[i] != b'*' {
                r.push(s[i]);
            }
        }
        println!("{}", String::from_utf8(r).unwrap());
    }
}

#[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::{stdin, stdout, BufWriter, StdoutLock, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[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 ) * } } ; }
#[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 , 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)]
pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
    let out = stdout();
    let writer = BufWriter::new(out.lock());
    f(writer)
}
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) } ; }
#[allow(dead_code)]
fn main() {
    input!{
        s: chars,
        k: usize,
    }
    let mut ans = s;
    let mut candy = 0;
    let mut snow = 0;
    for &c in &ans {
        if c == '?' {
            candy += 1;
        } else if c == '*' {
            snow += 1;
        }
    }
    let length = ans.len() - (candy + snow);
    debug!(length);
    if length < k {
        if snow == 0 {
            println!("Impossible");
            return;
        }
        let mut done = false;
        let mut i = 0;
        while i < ans.len() {
            if ans[i] == '?' {
                ans.remove(i);
                i -= 1;
            } else if ans[i] == '*' {
                ans.remove(i);
                i -= 1;
                if !done {
                    let x = ans[i];
                    let insert_pos = i;
                    for _j in 0..k-length {
                        ans.insert(insert_pos, x);
                        i += 1;
                    }
                    done = true;
                }
            }
            i += 1;
        }
    } else {
        if length - k > candy + snow {
            println!("Impossible");
            return;
        }
        let mut del = length - k;
        let mut index = 0;
        debug!(del);
        while del > 0 {
            if ans[index] == '?' || ans[index] == '*' {
                ans.remove(index-1);
                ans.remove(index-1);
                index -= 2;
                del -= 1;
            }
            index += 1;
        }
        debug!(ans);
        debug!(length);
        while index < ans.len() {
            if ans[index] == '?' || ans[index] == '*' {
                ans.remove(index);
                index -= 1;
            }
            index += 1;
        }
    }
    let str_ans: String = ans.into_iter().collect();
    println!("{}", str_ans);
}

use std::io;

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

#[derive(Debug)]
enum Group {
    Sequence(String),
    Optional(char),
    Some(char)
}

impl Group {
    fn is_sequence(&self) -> bool {
        match self {
            Group::Sequence(_) => true,
            _ => false
        }
    }

    fn get_sequence_mut(&mut self) -> &mut String {
        match self {
            Group::Sequence(ref mut seq) => seq,
            _ => panic!("kdkjndjfndi")
        }
    }
}

fn get_min_len(groups: &Vec<Group>) -> usize {
    let mut result = 0;
    for group in groups {
        match group {
            Group::Sequence(seq) => result += seq.len(),
            _ => {}
        }
    }
    result
}

fn get_max_len(groups: &Vec<Group>) -> Option<usize> {
    let mut result = 0;
    for group in groups {
        match group {
            Group::Sequence(seq) => result += seq.len(),
            Group::Optional(_) => result += 1,
            Group::Some(_) => return None
        }
    }
    Some(result)
}

fn generate(groups: &Vec<Group>, min_len: usize, dest_len: usize) -> String {
    let mut result = String::new();
    let mut left = dest_len - min_len;
    for group in groups {
        match group {
            Group::Sequence(seq) => result.push_str(&seq.to_string()),
            Group::Optional(ch) if left > 0 => {
                result.push(*ch);
                left -= 1;
            },
            Group::Some(ch) if left > 0 => {
                let mut to_push = String::with_capacity(left);
                for _ in 0..left {
                    to_push.push(*ch);
                }
                result.push_str(&to_push.to_string());
                left = 0;
            },
            _ => {}
        }
    }

    result
}

fn main() {
    let msg = readln!();
    let msg: Vec<char> = msg.chars().collect();

    let mut groups = Vec::new();

    let mut index = 0;
    while index < msg.len() - 1 {
        let len = groups.len();
        if msg[index + 1] == '?' {
            groups.push(Group::Optional(msg[index]));
            index += 2;
        } else if msg[index + 1] == '*' {
            groups.push(Group::Some(msg[index]));
            index += 2;
        } else if len == 0 || !groups[len - 1].is_sequence() {
            let mut to_push = String::new();
            to_push.push(msg[index]);
            groups.push(Group::Sequence(to_push));
            index += 1;
        } else {
            groups[len - 1].get_sequence_mut().push(msg[index]);
            index += 1;
        }
    }
    if index == msg.len() - 1 {
        let len = groups.len();
        if len == 0 || !groups[len - 1].is_sequence() {
            let mut to_push = String::new();
            to_push.push(msg[index]);
            groups.push(Group::Sequence(to_push));
        } else {
            groups[len - 1].get_sequence_mut().push(msg[index]);
        }
    }

    let dest_len = readln!(usize);
    let min_len = get_min_len(&groups);
    if min_len > dest_len {
        println!("Impossible");
        return;
    } if let Some(max_len) = get_max_len(&groups) {
        if max_len < dest_len {
            println!("Impossible");
            return;
        }
    }

    println!("{}", generate(&groups, min_len, dest_len));
}


use std::io;

fn main() {
    let mut s = String::new();
    for i in 0..5 {
        io::stdin().read_line(&mut s).unwrap();
    }
    let arr : Vec<i32> = s.split_whitespace().map(|s| s.parse().unwrap()).collect();
    let mut cnt = 0;
    for i in 1..arr[4]+1 {
        let mut flag = true;
        for j in 0..4 {
            if i % arr[j as usize] == 0 {
                flag = false;
            }
        }
        if flag == false {
            cnt += 1;
        }
    }
    println!("{}", cnt);
}

#[allow(unused)] use std::io::*;
#[allow(unused)] use std::collections::*;
#[allow(unused)] use std::mem::*;
#[allow(unused)] use std::num::*;
#[allow(unused)] use std::cmp::*;
#[allow(unused)] macro_rules! scan { ($($x:ty), +) => {{
    let mut inp = String::new(); stdin().read_line(&mut inp).ok();
    let s = inp.split(' ').map(|x| x.trim()).filter(|x| x.len() != 0).collect();
    let mut cnt : usize = 0;
    fn next<T>(cnt: &mut usize, p: &Vec<&str>) -> T where T:std::str::FromStr
    { *cnt += 1; p[*cnt-1].parse().ok().unwrap() }
    ($(next::<$x>(&mut cnt, &s)), +)
    }}; }
#[allow(unused)] macro_rules! arr { ($n:expr, $T:ty) => {{
    let mut inp = String::new(); stdin().read_line(&mut inp).ok();
    let mut s = inp.split(' ').map(|x| x.trim()).filter(|x| x.len() != 0);
    let mut v = Vec::new(); v.reserve(($n) as usize);
    for st in s { v.push(st.parse::<$T>().unwrap()); } v
    }}; }

///////////////////////////////////////////////////////////////////////////////
fn main()
{
    let k = scan!(i32);
    let l = scan!(i32);
    let m = scan!(i32);
    let n = scan!(i32);
    let v = scan!(i32);
    let mut cnt = 0;
    for i in 1..v+1 {
        if i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0 { cnt += 1; }
    }
    println!("{}", cnt);
}

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

fn main() {
    let k = input();
    let l = input();
    let m = input();
    let n = input();
    let objects = [k, l, m, n];
    let d = input(); // total number of dragons

    // true if hit
    let mut dragons: Vec<bool> = Vec::with_capacity(d as usize);
    for _ in 0..d {
        dragons.push(false)
    }

    for step in objects.iter() {
        let mut index = *step;
        while index <= d {
            dragons[(index - 1) as usize] = true;
            index += step;
        }
    }

    println!("{}", dragons.iter().filter(|&&a| a).count());
}

//spnauti-rust
struct WordReader {
    it : std::vec::IntoIter<String>,
}
#[allow(dead_code)]
impl WordReader {
    fn new<T : std::io::Read>(mut reader : T) -> WordReader {
        let mut s = String::new();
        reader.read_to_string(&mut s).unwrap();
        WordReader { it : s
            .split_ascii_whitespace()
            .map(String::from).collect::<Vec<_>>()
            .into_iter()
        }
    }
    fn from_stdin() -> WordReader {
        WordReader::new(std::io::stdin())
    }
    fn s(&mut self) -> String {
        self.it.next().unwrap()
    }
    fn ab(&mut self) -> Vec<u8> {
        self.it.next().unwrap().into_bytes()
    }
    fn i(&mut self) -> i32 {
        self.it.next().unwrap().parse().unwrap()
    }
}

fn main() {
    let mut input = WordReader::from_stdin();
    let mut a = [0; 4];
    for x in a.iter_mut() {
        *x = input.i();
    }
    let n = input.i();
    let sol = (1..n+1).filter(|x| a.iter().any(|y| x % y == 0)).count();
    println!("{}", sol);
}

fn main() {
    let k: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let l: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let m: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let n: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let d: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let x = vec![k, l, m, n];
    let ret = (1..d + 1).fold(0, |total, i| if x.iter().any(|&k| i % k == 0) {
        total + 1
    } else {
        total
    });
    println!("{:?}", ret);
}

#[allow(unused_imports)]
use std::cmp::{min,max};
use std::collections::{*};
use std::io::{BufWriter, stdin, stdout, Write};
const BITS: usize = 19;

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>
}
impl Scanner {
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn main() {
    let mut scanner = Scanner::default();
    let arr: [u64;5] = [scanner.next(), scanner.next(), scanner.next(), scanner.next(), scanner.next()];
    print!["{}", (1..=arr[4]).filter(|x| x % arr[0] == 0 || x % arr[1] == 0 || x % arr[2] == 0 || x % arr[3] == 0).count()];
}

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

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

    let k: i64 = iterator
        .next().unwrap().unwrap().parse().unwrap_or(0);
    let l: i64 = iterator
        .next().unwrap().unwrap().parse().unwrap_or(0);
    let m: i64 = iterator
        .next().unwrap().unwrap().parse().unwrap_or(0);
    let n: i64 = iterator
        .next().unwrap().unwrap().parse().unwrap_or(0);
    let d: i64 = iterator
        .next().unwrap().unwrap().parse().unwrap_or(0);

    for i in 1..=d {
        if i % k == 0 ||
            i % l == 0 ||
            i % m == 0 ||
            i % n == 0 {
                damaged += 1;
        }
    }

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

// {{{ 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),*);
    }
}

// }}}

fn gcd(a: u32, b: u32) -> u32 {
    if b == 0 { a } else { gcd(b, a % b) }
}

fn lcm(a: u32, b:u32) -> u32 {
    a * b / gcd(a, b)
}

macro_rules! lcm {
    ( $x:expr ) => {{
        $x
    }};
    ( $x:expr, $($xs:expr),* ) => {{
        lcm($x, lcm!($($xs),*))
    }}
}

fn main() {
    let (k, ) = R!(u32);
    let (l, ) = R!(u32);
    let (m, ) = R!(u32);
    let (n, ) = R!(u32);
    let (d, ) = R!(u32);
    println!("{}",
        d/k + d/l + d/m + d/n
        - d/lcm!(k,l) - d/lcm!(k,m) - d/lcm!(k,n) - d/lcm!(l,m) - d/lcm!(l,n) - d/lcm!(m,n)
        + d/lcm!(k,l,m) + d/lcm!(k,l,n) + d/lcm!(k,m,n) + d/lcm!(l,m,n)
        - d/lcm!(k,l,m,n));
}

use std::io::*;

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

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

    let k: u32 = read(sin);
    let l: u32 = read(sin);
    let m: u32 = read(sin);
    let n: u32 = read(sin);
    let d: u32 = read(sin);

    let ans = (1..d + 1)
        .filter(|x| *x % k == 0 || *x % l == 0 || *x % m == 0 || *x % n == 0)
        .count();

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

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

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

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

    let k: i64 = k.trim().parse().unwrap();

    let mut l = String::new();

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

    let l: i64 = l.trim().parse().unwrap();

    let mut m = String::new();

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

    let m: i64 = m.trim().parse().unwrap();

    let mut n = String::new();

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

    let n: i64 = n.trim().parse().unwrap();

    let mut d = String::new();

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

    let d: i64 = d.trim().parse().unwrap();

    let mut dragons = 0;

    for idx in 1..d+1 {
        if idx % k == 0
            || idx % l == 0
            || idx % m == 0
            || idx % n == 0 {
            dragons += 1;
        }
    }

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

use std::io::{self, prelude::*};

#[allow(unused_must_use)]
#[allow(unused_assignments)]
#[allow(unused_variables)]
fn solve<B: BufRead, W: Write>(mut scan: Scanner<B>, mut w: W) {
    let k = scan.token::<usize>();
    let l = scan.token::<usize>();
    let m = scan.token::<usize>();
    let n = scan.token::<usize>();
    let d = scan.token::<usize>();

    let mut arr = vec![false; d];

    for i in (0..d).skip(k-1).step_by(k) {
        arr[i] = true;
    }
    for i in (0..d).skip(l-1).step_by(l) {
        arr[i] = true;
    }
    for i in (0..d).skip(m-1).step_by(m) {
        arr[i] = true;
    }
    for i in (0..d).skip(n-1).step_by(n) {
        arr[i] = true;
    }

    let ans: usize = arr.iter().filter(|&e| *e).count();

    writeln!(w, "{}", ans);
}

fn main() {
    let stdin = io::stdin();
    let stdout = io::stdout();
    let reader = Scanner::new(stdin.lock());
    let writer = io::BufWriter::new(stdout.lock());
    solve(reader, writer);
}
#[allow(dead_code)]
fn vector_to_str<T: ToString>(vector: &Vec<T>, separator: &str) -> String {
    use std::fmt::Write;
    let mut ans = String::new();
    for line in vector.iter() {
        write!(&mut ans, "{}{}", line.to_string(), separator).unwrap();
    }
    ans
}
#[allow(dead_code)]
fn matrix_to_str<T: ToString>(matrix: &Vec<Vec<T>>, separator: &str) -> String {
    use std::fmt::Write;
    let mut ans = String::new();
    for line in matrix.iter() {
        for elem in line.iter() {
            write!(&mut ans, "{}{}", elem.to_string(), separator).unwrap();
        }
        write!(&mut ans, "\n").unwrap();
    }
    ans
}
pub struct Scanner<B> {
    reader: B,
    buf_str: Vec<u8>,
    buf_iter: std::str::SplitWhitespace<'static>,
}
impl<B: BufRead> Scanner<B> {
    pub fn new(reader: B) -> Self {
        Self {
            reader,
            buf_str: Vec::new(),
            buf_iter: "".split_whitespace()
        }
    }
    pub fn token<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buf_iter.next() {
                return token.parse().ok().expect("Failed parse");
            }
            self.buf_str.clear();
            self.reader.read_until(b'\n', &mut self.buf_str).expect("Failed read");
            self.buf_iter = unsafe {
                let slice = std::str::from_utf8_unchecked(&self.buf_str);
                std::mem::transmute(slice.split_whitespace()) }
        }
    }
    pub fn get_matrix<T: std::str::FromStr>(&mut self, m: usize, n: usize) -> Vec<Vec<T>> {
        // m rows and n columns
        let mut ans: Vec<Vec<T>> = Vec::with_capacity(m);
        for i in 0..m {
            ans.push(Vec::with_capacity(n));
            for _ in 0..n {
                ans[i].push(self.token::<T>());
            }
        }
        ans
    }
    pub fn get_vector<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        let mut ans: Vec<T> = Vec::with_capacity(n);
        for _ in 0..n {
            ans.push(self.token::<T>());
        }
        ans
    }
}

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

fn main() {
    let mut c = 0;
    let k = read_line().to::<usize>();
    let l = read_line().to::<usize>();
    let m = read_line().to::<usize>();
    let n = read_line().to::<usize>();
    let d = read_line().to::<usize>();

    for i in 1..=d {
        if i % k == 0
        || i % l == 0
        || i % m == 0
        || i % n == 0
        {
            c += 1;
        }
    }

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

fn read_line() -> String {
    let mut buffer = String::new();
    std::io::stdin().read_line(&mut buffer).expect("Ошибка чтения");

    buffer.trim().to_string()
}

trait ParseStr {
    fn to_vec<T>(&self, separator: &str) -> Vec<T>
    where
        T: FromStr,
        <T as std::str::FromStr>::Err: std::fmt::Debug;

    fn to_vec_chars(&self) -> Vec<char>;

    fn to<T>(&self) -> T
    where
        T: FromStr + Copy,
        <T as std::str::FromStr>::Err: Debug;
}

impl ParseStr for String {

    fn to_vec<T>(&self, separator: &str) -> Vec<T>
    where
        T: FromStr,
        <T as std::str::FromStr>::Err: Debug,
    {
        self.split(separator).map(|c| c.parse::<T>().expect("Ошибка преобразования")).collect()
    }

    fn to_vec_chars(&self) -> Vec<char> {
        self.chars().collect()
    }

    fn to<T>(&self) -> T
    where
        T: FromStr + Copy,
        <T as std::str::FromStr>::Err: Debug,
    {
        ParseStr::to_vec::<T>(self, " ")[0]
    }
}

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

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

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

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

fn gcd(a : u64, b : u64) -> u64 {
    let mut t_a = if a > b { a } else { b };
    let mut t_b = if t_a == a { b } else { a };
    loop {
        if t_b == 0 {
            return t_a;
        } else {
            let t_a_mod_t_b = t_a % t_b;
            t_a = t_b;
            t_b = t_a_mod_t_b;
        }
    }
}

fn lcm(a : u64, b : u64) -> u64 {
    let g = gcd(a, b);
    (a / g) * b
}

macro_rules! lcm_list {
    ($x:expr) => ($x);
    ($x:expr, $($y:expr),+) => (
        lcm($x, lcm_list!($($y),+))
    )
}

fn num_damaged_dragons(k : u64, l : u64, m : u64, n : u64, d : u64) -> u64 {
    let t_k = d / k;
    let t_l = d / l;
    let t_m = d / m;
    let t_n = d / n;
    let t_k_l = d / lcm_list!(k, l);
    let t_k_m = d / lcm_list!(k, m);
    let t_k_n = d / lcm_list!(k, n);
    let t_l_m = d / lcm_list!(l, m);
    let t_l_n = d / lcm_list!(l, n);
    let t_m_n = d / lcm_list!(m, n);
    let t_k_l_m = d / lcm_list!(k, l, m);
    let t_k_l_n = d / lcm_list!(k, l, n);
    let t_k_m_n = d / lcm_list!(k, m, n);
    let t_l_m_n = d / lcm_list!(l, m, n);
    let t_k_l_m_n = d / lcm_list!(k, l, m, n);
    let t_1 = t_k + t_l + t_m + t_n;
    let t_2 = t_k_l + t_k_m + t_k_n + t_l_m + t_l_n + t_m_n;
    let t_3 = t_k_l_m + t_k_l_n + t_k_m_n + t_l_m_n;
    let t_4 = t_k_l_m_n;
    t_1 - t_2 + t_3 - t_4
}

fn main() {
    let stdin = io::stdin();
    let k = read_t(&stdin);
    let l = read_t(&stdin);
    let m = read_t(&stdin);
    let n = read_t(&stdin);
    let d = read_t(&stdin);
    let r = num_damaged_dragons(k, l, m, n, d);
    println!("{}", r);
}

use std::str::FromStr;

fn read_str() -> String {
    let mut buffer: String = String::new();
    std::io::stdin().read_line(&mut buffer).expect("Error");
    buffer.trim().to_string()
}

fn read_int<T: FromStr>() -> T{
    read_str().parse::<T>().ok().expect("Error")
}

fn main() {
    let (k, l, m, n, d): (u32, u32, u32, u32, u32) = (
        read_int(), read_int(), read_int(), read_int(), read_int());

    let mut total: u32 = 0;
    for index in 1..d + 1 {
        if index % k == 0 { total += 1; }
        else if index % l == 0 { total += 1; }
        else if index % m == 0 { total += 1; }
        else if index % n == 0 { total += 1; }
    }
    print!("{}", total);
}

fn readln() -> Vec<i32> {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();

    line.split_whitespace()
        .map(|s| s.parse().unwrap())
        .collect()
}

fn main() {
    let mut input = readln();
    let k = input[0];
    input = readln();
    let l = input[0];
    input = readln();
    let m = input[0];
    input = readln();
    let n = input[0];
    input = readln();
    let d = input[0];

    let mut ans = 0;
    for i in 1..(d + 1) {
        if i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0 {
            ans += 1;
        }
    }

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

fn main() {
    let (k, l, m, n, d) = {
        let mut bufs: Vec<usize> = Vec::new();
        for _ in 0..5 {
            let mut buf = String::new();
            std::io::stdin().read_line(&mut buf).unwrap();
            bufs.push(buf.trim_end().parse().unwrap());
        }
        (bufs[0], bufs[1], bufs[2], bufs[3], bufs[4])
    };

    let mut ans = 0;
    for i in 0..d {
        let num = i + 1;
        if num % k == 0 || num % l == 0 || num % m == 0 || num % n == 0 {
            ans += 1
        }
    }
    println!("{}", ans);
}

use std::io;
use std::io::{Write};
use std::str;

/// Reads white-space separated tokens one at a time.
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![],
        }
    }

    /// Use "turbofish" syntax token::<T>() to select data type of next token.
    ///
    /// # Panics
    ///
    /// Panics if there's an I/O error or if the token cannot be parsed as T.
    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();
        }
    }
}

/// Same API as Scanner but nearly twice as fast, using horribly unsafe dark arts
/// **REQUIRES** Rust 1.34 or higher
pub struct UnsafeScanner<R> {
    reader: R,
    buf_str: Vec<u8>,
    buf_iter: str::SplitAsciiWhitespace<'static>,
}

impl<R: io::BufRead> UnsafeScanner<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buf_str: vec![],
            buf_iter: "".split_ascii_whitespace(),
        }
    }

    /// This function should be marked unsafe, but noone has time for that in a
    /// programming contest. Use at your own risk!
    pub fn token<T: str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buf_iter.next() {
                return token.parse().ok().expect("Failed parse");
            }
            self.buf_str.clear();
            self.reader
                .read_until(b'\n', &mut self.buf_str)
                .expect("Failed read");
            self.buf_iter = unsafe {
                let slice = str::from_utf8_unchecked(&self.buf_str);
                std::mem::transmute(slice.split_ascii_whitespace())
            }
        }
    }
}

pub fn scanner_from_file(filename: &str) -> Scanner<io::BufReader<std::fs::File>> {
    let file = std::fs::File::open(filename).expect("Input file not found");
    Scanner::new(io::BufReader::new(file))
}

pub fn writer_to_file(filename: &str) -> io::BufWriter<std::fs::File> {
    let file = std::fs::File::create(filename).expect("Output file not found");
    io::BufWriter::new(file)
}

fn solve() {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = Scanner::new(stdin.lock());
    let mut out = io::BufWriter::new(stdout.lock());
    let  k = scan.token::<i32>();
    let  l = scan.token::<i32>();
    let  m = scan.token::<i32>();
    let  n = scan.token::<i32>();
    let  d = scan.token::<i32>();
    let mut ans = 0;
    for i in 1..=d {
        if i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0 {
            ans += 1;
        }
    }
    out.write(format!("{}", ans).as_bytes()).unwrap();
    // let k = scan.token::<i32>();
    // let mut arr = scan.token::<String>().chars().collect::<Vec<char>>();
}

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

use std::io;

fn main() {
	let mut k = String::new();
	io::stdin().read_line(&mut k).unwrap();
	let k: i32 = k.trim().parse().unwrap();

	let mut l = String::new();
	io::stdin().read_line(&mut l).unwrap();
	let l: i32 = l.trim().parse().unwrap();

	let mut m = String::new();
	io::stdin().read_line(&mut m).unwrap();
	let m: i32 = m.trim().parse().unwrap();

	let mut n = String::new();
	io::stdin().read_line(&mut n).unwrap();
	let n: i32 = n.trim().parse().unwrap();

	let mut d = String::new();
	io::stdin().read_line(&mut d).unwrap();
	let d: i32 = d.trim().parse().unwrap();

	let mut ans = 0;
	for i in 1..=d {
		if i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0 {
			ans += 1;
		}
	}

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

use std::io;

fn main() {

    let mut d = String::new();
    let mut klmn: [String;4] = [String::new(), String::new(),String::new(),String::new()];

    io::stdin().read_line(&mut klmn[0]).unwrap();
    io::stdin().read_line(&mut klmn[1]).unwrap();
    io::stdin().read_line(&mut klmn[2]).unwrap();
    io::stdin().read_line(&mut klmn[3]).unwrap();
    io::stdin().read_line(&mut d).unwrap();

    let nd: i32 = d.trim().parse().unwrap();
    let mut k: [i32; 4] = [0,0,0,0];
    k[0] = klmn[0].trim().parse().unwrap();
    k[1] = klmn[1].trim().parse().unwrap();
    k[2] = klmn[2].trim().parse().unwrap();
    k[3] = klmn[3].trim().parse().unwrap();
    if k[0] == 1 || k[1] == 1 || k[2] == 1 ||k[3] == 1 {println!("{}",nd);return;}
    let mut count = 0;
    for i in 1..nd+1 {
        if i % k[0] == 0 || i % k[1] == 0 || i % k[2] == 0 || i % k[3] == 0 {
            count = count + 1;
        }
    }
        println!("{}",count);
}

// fn count_primes(n: i32) -> i32 {
//     let mut count = 0
//     if n <= 1 { return 0; }
//     else if n == 2 { count++; }
//     else if n % 2 == 0{ return false; }
//     else {
//         let mut i = 1;
//         while i < sqrt(n){
//             i = i + 2;
//             if n % i == 0 {
//                 return false;
//             }
//         }
//         return true;
//     }
// }

// fn is_prime(n: i32) -> bool {
//     if n <= 1 { return false; }
//     else if n == 2 { return true; }
//     else if n % 2 == 0{ return false; }
//     else {
//         let mut i = 1;
//         while i < sqrt(n){
//             i = i + 2;
//             if n % i == 0 {
//                 return false;
//             }
//         }
//         return true;
//     }
// }

#![allow(non_snake_case, unused_imports)]

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

// Module
use std::cmp::{min,max};
use std::collections::{HashSet,HashMap,VecDeque,BinaryHeap};

// Functions

// Main
fn main(){

    input!{
        K: usize,
        L: usize,
        M: usize,
        N: usize,
        D: usize
    }

    let mut ans = 0;
    for d in 1..D+1{
        if d%K==0 || d%L==0 || d%M==0 || d%N==0{
            ans += 1;
        }
    }
    println!("{}", ans);
}

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

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>
}
impl Scanner {
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

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

	let k = scan.next::<usize>();
	let l = scan.next::<usize>();
	let m = scan.next::<usize>();
	let n = scan.next::<usize>();
	let d = scan.next::<usize>();

    let res = (1..=d).filter(|x| x % k == 0 || x % l == 0 || x % m == 0 || x % n == 0).count();
    writeln!(out, "{}", res).expect("fail");
}

fn main() {
    let k: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let l: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let m: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let n: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let d: i32 = {
        let mut line = String::new();
        std::io::stdin().read_line(&mut line);
        line.trim().parse().unwrap()
    };

    let x = vec![k, l, m, n];
    let ret = (0..d).fold(0, |total, i| if x.iter().any(|&k| i % k == 0) {
        total + 1
    } else {
        total
    });
    println!("{:?}", ret);
}

use std::str::FromStr;

fn read_str() -> String {
    let mut buffer: String = String::new();
    std::io::stdin().read_line(&mut buffer).expect("Error");
    buffer.trim().to_string()
}

fn read_int<T: FromStr>() -> T{
    read_str().parse::<T>().ok().expect("Error")
}

fn main() {
    let (k, l, m, n, d): (u32, u32, u32, u32, u32) = (
        read_int(), read_int(), read_int(), read_int(), read_int());

    let mut total: u32 = 0;
    for index in 0..d {
        if index % k == 0 { total += 1; }
        else if index % l == 0 { total += 1; }
        else if index % m == 0 { total += 1; }
        else if index % n == 0 { total += 1; }
    }
    print!("{}", total);
}

use std::str::FromStr;

fn read_str() -> String {
    let mut buffer: String = String::new();
    std::io::stdin().read_line(&mut buffer).expect("Error");
    buffer.trim().to_string()
}

fn read_int<T: FromStr>() -> T{
    read_str().parse::<T>().ok().expect("Error")
}

fn main() {
    let (k, l, m, n, d): (u32, u32, u32, u32, u32) = (
        read_int(), read_int(), read_int(), read_int(), read_int());

    let mut total: u32 = 0;
    for index in 1..d {
        if index % k == 0 { total += 1; }
        else if index % l == 0 { total += 1; }
        else if index % m == 0 { total += 1; }
        else if index % n == 0 { total += 1; }
    }
    print!("{}", total);
}

use std::io;

fn main() {
	let mut k = String::new();
	io::stdin().read_line(&mut k).unwrap();
	let k: i32 = k.trim().parse().unwrap();

	let mut l = String::new();
	io::stdin().read_line(&mut l).unwrap();
	let l: i32 = l.trim().parse().unwrap();

	let mut m = String::new();
	io::stdin().read_line(&mut m).unwrap();
	let m: i32 = m.trim().parse().unwrap();

	let mut n = String::new();
	io::stdin().read_line(&mut n).unwrap();
	let n: i32 = n.trim().parse().unwrap();

	let mut d = String::new();
	io::stdin().read_line(&mut d).unwrap();
	let d: i32 = d.trim().parse().unwrap();

	let mut ans = 0;
	for i in 0..d {
		if i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0 {
			ans += 1;
		}
	}

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

use std::io;

fn main() {

    let mut d = String::new();
    let mut klmn: [String;4] = [String::new(), String::new(),String::new(),String::new()];

    io::stdin().read_line(&mut klmn[0]).unwrap();
    io::stdin().read_line(&mut klmn[1]).unwrap();
    io::stdin().read_line(&mut klmn[2]).unwrap();
    io::stdin().read_line(&mut klmn[3]).unwrap();
    io::stdin().read_line(&mut d).unwrap();

    let nd: i32 = d.trim().parse().unwrap();
    let mut k: [i32; 4] = [0,0,0,0];
    k[0] = klmn[0].trim().parse().unwrap();
    k[1] = klmn[1].trim().parse().unwrap();
    k[2] = klmn[2].trim().parse().unwrap();
    k[3] = klmn[3].trim().parse().unwrap();
    if k[0] == 1 || k[1] == 1 || k[2] == 1 ||k[3] == 1 {println!("{}",nd);return;}
    let mut count = 1;
    for i in 1..nd {
        if i % k[0] == 0 || i % k[1] == 0 || i % k[2] == 0 || i % k[3] == 0 {
            count = count + 1;
        }
    }
        println!("{}",count);
}

// fn count_primes(n: i32) -> i32 {
//     let mut count = 0
//     if n <= 1 { return 0; }
//     else if n == 2 { count++; }
//     else if n % 2 == 0{ return false; }
//     else {
//         let mut i = 1;
//         while i < sqrt(n){
//             i = i + 2;
//             if n % i == 0 {
//                 return false;
//             }
//         }
//         return true;
//     }
// }

// fn is_prime(n: i32) -> bool {
//     if n <= 1 { return false; }
//     else if n == 2 { return true; }
//     else if n % 2 == 0{ return false; }
//     else {
//         let mut i = 1;
//         while i < sqrt(n){
//             i = i + 2;
//             if n % i == 0 {
//                 return false;
//             }
//         }
//         return true;
//     }
// }

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

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>
}
impl Scanner {
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

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

	let k = scan.next::<usize>();
	let l = scan.next::<usize>();
	let m = scan.next::<usize>();
	let n = scan.next::<usize>();
	let d = scan.next::<usize>();

    let res = (0..d).filter(|x| x % k == 0 || x % l == 0 || x % m == 0 || x % n == 0).count();
    writeln!(out, "{}", res).expect("fail");
}


use std::io;

fn main() {
    let mut ss: String = String::new();
    io::stdin().read_line(&mut ss).unwrap();
    let n: u64 = ss.trim().parse().unwrap();

    let mut l: u64 = 1;
    let mut r: u64 = n;
    let mut m: u64;

    if tryv(n, 1) { println!("1"); return; }

    loop {
        // println!("l: {}, r: {}", l, r);
        if l + 1 == r {
            break;
        }
        m = (l + r) / 2;
        // println!("m: {}", m);
        if tryv(n, m) {
            r = m;
        } else {
            l = m;
        }
    }

    if tryv(n, l) {
        println!("{}", l);
    } else {
        println!("{}", r);
    }
    return;
}

fn tryv(nn: u64, k: u64) -> bool {
    // println!("n: {}, k: {}", nn, k);
    // println!("=====================");
    if k == 0 { return false; }
    let mut n = nn;
    let mut v: u64 = 0;
    loop {
        if v >= nn/2 + nn%2{
            return true;
        } else if v + n < nn/2 + nn%2 {
            return false;
        }

        if k >= n {
            v += n;
            n = 0;
        } else {
            v += k;
            n -= k;
        }

        n -= n/10;
        // println!("left: {}, vasya: {}", n, v);
    }
}

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

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

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

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

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

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

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

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

        p <= v
    };

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

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

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

use std::io;

fn main() {
    let mut ss: String = String::new();
    io::stdin().read_line(&mut ss).unwrap();
    let n: u64 = ss.trim().parse().unwrap();

    let mut l: u64 = 1;
    let mut r: u64 = (n/2) + (n%2);
    let mut m: u64;

    if tryv(n, 1) { println!("1"); return; }

    loop {
        if l + 1 == r {
            break;
        }
        m = (l + r) / 2;
        if tryv(n, m) {
            r = m;
        } else {
            l = m;
        }
    }

    println!("{}", r);
    return;
}

fn tryv(nn: u64, k: u64) -> bool {
    // println!("n: {}, k: {}", nn, k);
    // println!("=====================");
    if k == 0 { return false; }
    let mut n = nn;
    let mut v: u64 = 0;
    loop {
        if v >= nn/2 {
            return true;
        } else if v + n < nn/2 {
            return false;
        }

        if k >= n {
            v += n;
            n = 0;
        } else {
            v += k;
            n -= k;
        }

        n -= n/10;
        // println!("left: {}, vasya: {}", n, v);
    }
}

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

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

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

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

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

        p <= v
    };

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

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

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


pub trait Readable {
    type Output;
    fn words_count() -> usize;
    fn read_words(words: &[&str]) -> Result<Self::Output, String>;
}
#[macro_export]
macro_rules! readable {
    ( $ t : ty , $ words_count : expr , |$ words : ident | $ read_words : expr ) => {
        impl Readable for $t {
            type Output = $t;
            fn words_count() -> usize {
                $words_count
            }
            fn read_words($words: &[&str]) -> Result<$t, String> {
                Ok($read_words)
            }
        }
    };
}
readable!((), 1, |_ss| ());
readable!(String, 1, |ss| ss[0].to_string());
impl Readable for char {
    type Output = char;
    fn words_count() -> usize {
        1
    }
    fn read_words(words: &[&str]) -> Result<char, String> {
        let chars: Vec<char> = words[0].chars().collect();
        if chars.len() == 1 {
            Ok(chars[0])
        } else {
            Err(format!("cannot parse `{}` as a char", words[0]))
        }
    }
}
pub struct Chars();
impl Readable for Chars {
    type Output = Vec<char>;
    fn words_count() -> usize {
        1
    }
    fn read_words(words: &[&str]) -> Result<Vec<char>, String> {
        Ok(words[0].chars().collect())
    }
}
macro_rules ! impl_readable_for_ints { ( $ ( $ t : ty ) * ) => { $ ( impl Readable for $ t { type Output = Self ; fn words_count ( ) -> usize { 1 } fn read_words ( words : & [ & str ] ) -> Result <$ t , String > { use std :: str :: FromStr ; <$ t >:: from_str ( words [ 0 ] ) . map_err ( | _ | { format ! ( "cannot parse `{}` as {}" , words [ 0 ] , stringify ! ( $ t ) ) } ) } } ) * } ; }
impl_readable_for_ints ! ( i8 u8 i16 u16 i32 u32 i64 u64 isize usize f32 f64 ) ;
macro_rules ! define_one_origin_int_types { ( $ new_t : ident $ int_t : ty ) => { # [ doc = " Converts 1-origin integer into 0-origin when read from stdin." ] # [ doc = "" ] # [ doc = " # Example" ] # [ doc = "" ] # [ doc = " ```no_run" ] # [ doc = " # #[macro_use] extern crate atcoder_snippets;" ] # [ doc = " # use atcoder_snippets::read::*;" ] # [ doc = " // Stdin: \"1\"" ] # [ doc = " read!(a = usize_);" ] # [ doc = " assert_eq!(a, 0);" ] # [ doc = " ```" ] # [ allow ( non_camel_case_types ) ] pub struct $ new_t ; impl Readable for $ new_t { type Output = $ int_t ; fn words_count ( ) -> usize { 1 } fn read_words ( words : & [ & str ] ) -> Result < Self :: Output , String > { <$ int_t >:: read_words ( words ) . map ( | n | n - 1 ) } } } ; ( $ new_t : ident $ int_t : ty ; $ ( $ inner_new_t : ident $ inner_int_t : ty ) ;* ) => { define_one_origin_int_types ! ( $ new_t $ int_t ) ; define_one_origin_int_types ! ( $ ( $ inner_new_t $ inner_int_t ) ;* ) ; } ; }
define_one_origin_int_types ! ( u8_ u8 ; u16_ u16 ; u32_ u32 ; u64_ u64 ; usize_ usize ) ;
macro_rules ! impl_readable_for_tuples { ( $ t : ident $ var : ident ) => ( ) ; ( $ t : ident $ var : ident ; $ ( $ inner_t : ident $ inner_var : ident ) ;* ) => { impl_readable_for_tuples ! ( $ ( $ inner_t $ inner_var ) ;* ) ; impl <$ t : Readable , $ ( $ inner_t : Readable ) ,*> Readable for ( $ t , $ ( $ inner_t ) ,* ) { type Output = ( <$ t >:: Output , $ ( <$ inner_t >:: Output ) ,* ) ; fn words_count ( ) -> usize { let mut n = <$ t >:: words_count ( ) ; $ ( n += <$ inner_t >:: words_count ( ) ; ) * n } # [ allow ( unused_assignments ) ] fn read_words ( words : & [ & str ] ) -> Result < Self :: Output , String > { let mut start = 0 ; let $ var = <$ t >:: read_words ( & words [ start .. start +<$ t >:: words_count ( ) ] ) ?; start += <$ t >:: words_count ( ) ; $ ( let $ inner_var = <$ inner_t >:: read_words ( & words [ start .. start +<$ inner_t >:: words_count ( ) ] ) ?; start += <$ inner_t >:: words_count ( ) ; ) * Ok ( ( $ var , $ ( $ inner_var ) ,* ) ) } } } ; }
impl_readable_for_tuples ! ( T8 x8 ; T7 x7 ; T6 x6 ; T5 x5 ; T4 x4 ; T3 x3 ; T2 x2 ; T1 x1 ) ;
pub trait ReadableFromLine {
    type Output;
    fn read_line(line: &str) -> Result<Self::Output, String>;
}
fn split_into_words(line: &str) -> Vec<&str> {
    #[allow(deprecated)]
    line.trim_right_matches('\n').split_whitespace().collect()
}
impl<T: Readable> ReadableFromLine for T {
    type Output = T::Output;
    fn read_line(line: &str) -> Result<T::Output, String> {
        let words = split_into_words(line);
        if words.len() != T::words_count() {
            return Err(format!(
                "line `{}` has {} words, expected {}",
                line,
                words.len(),
                T::words_count()
            ));
        }
        T::read_words(&words)
    }
}
macro_rules ! impl_readable_from_line_for_tuples_with_from_iterator { ( $ u : ident : $ ( + $ bound : path ) * => $ seq_in : ty , $ seq_out : ty ; $ t : ident $ var : ident ) => { impl <$ u : Readable > ReadableFromLine for $ seq_in where <$ u as Readable >:: Output : Sized $ ( + $ bound ) * { type Output = $ seq_out ; fn read_line ( line : & str ) -> Result <$ seq_out , String > { let n = $ u :: words_count ( ) ; let words = split_into_words ( line ) ; if words . len ( ) % n != 0 { return Err ( format ! ( "line `{}` has {} words, expected multiple of {}" , line , words . len ( ) , n ) ) ; } let mut result = Vec :: new ( ) ; for chunk in words . chunks ( n ) { match $ u :: read_words ( chunk ) { Ok ( v ) => result . push ( v ) , Err ( msg ) => { let flagment_msg = if n == 1 { format ! ( "word {}" , result . len ( ) ) } else { let l = result . len ( ) ; format ! ( "words {}-{}" , n * l + 1 , ( n + 1 ) * l ) } ; return Err ( format ! ( "{} of line `{}`: {}" , flagment_msg , line , msg ) ) ; } } } Ok ( result . into_iter ( ) . collect ( ) ) } } impl < T : Readable , $ u : Readable > ReadableFromLine for ( T , $ seq_in ) where <$ u as Readable >:: Output : Sized $ ( + $ bound ) * { type Output = ( T :: Output , $ seq_out ) ; fn read_line ( line : & str ) -> Result < Self :: Output , String > { let n = T :: words_count ( ) ; # [ allow ( deprecated ) ] let trimmed = line . trim_right_matches ( '\n' ) ; let words_and_rest : Vec <& str > = trimmed . splitn ( n + 1 , ' ' ) . collect ( ) ; if words_and_rest . len ( ) < n { return Err ( format ! ( "line `{}` has {} words, expected at least {}" , line , words_and_rest . len ( ) , n ) ) ; } let words = & words_and_rest [ .. n ] ; let empty_str = "" ; let rest = words_and_rest . get ( n ) . unwrap_or ( & empty_str ) ; Ok ( ( T :: read_words ( words ) ?, <$ seq_in >:: read_line ( rest ) ? ) ) } } } ; ( $ u : ident : $ ( + $ bound : path ) * => $ seq_in : ty , $ seq_out : ty ; $ t : ident $ var : ident , $ ( $ inner_t : ident $ inner_var : ident ) ,+ ) => { impl_readable_from_line_for_tuples_with_from_iterator ! ( $ u : $ ( + $ bound ) * => $ seq_in , $ seq_out ; $ ( $ inner_t $ inner_var ) ,+ ) ; impl <$ t : Readable , $ ( $ inner_t : Readable ) ,+ , $ u : Readable > ReadableFromLine for ( $ t , $ ( $ inner_t ) ,+ , $ seq_in ) where <$ u as Readable >:: Output : Sized $ ( + $ bound ) * { type Output = ( $ t :: Output , $ ( $ inner_t :: Output ) ,+ , $ seq_out ) ; fn read_line ( line : & str ) -> Result < Self :: Output , String > { let mut n = $ t :: words_count ( ) ; $ ( n += $ inner_t :: words_count ( ) ; ) + # [ allow ( deprecated ) ] let trimmed = line . trim_right_matches ( '\n' ) ; let words_and_rest : Vec <& str > = trimmed . splitn ( n + 1 , ' ' ) . collect ( ) ; if words_and_rest . len ( ) < n { return Err ( format ! ( "line `{}` has {} words, expected at least {}" , line , words_and_rest . len ( ) , n ) ) ; } let words = & words_and_rest [ .. n ] ; let empty_str = "" ; let rest = words_and_rest . get ( n ) . unwrap_or ( & empty_str ) ; let ( $ var , $ ( $ inner_var ) ,* ) = < ( $ t , $ ( $ inner_t ) ,+ ) >:: read_words ( words ) ?; Ok ( ( $ var , $ ( $ inner_var ) ,* , <$ seq_in >:: read_line ( rest ) ? ) ) } } } ; }
#[macro_export]
macro_rules ! readable_collection { ( $ u : ident => $ collection_in : ty , $ collection_out : ty ) => { impl_readable_from_line_for_tuples_with_from_iterator ! ( $ u : => $ collection_in , $ collection_out ; T8 x8 , T7 x7 , T6 x6 , T5 x5 , T4 x4 , T3 x3 , T2 x2 , T1 x1 ) ; } ; ( $ u : ident : $ ( $ bound : path ) ,* => $ collection_in : ty , $ collection_out : ty ) => { impl_readable_from_line_for_tuples_with_from_iterator ! ( $ u : $ ( + $ bound ) * => $ collection_in , $ collection_out ; T8 x8 , T7 x7 , T6 x6 , T5 x5 , T4 x4 , T3 x3 , T2 x2 , T1 x1 ) ; } }
readable_collection ! ( U => Vec < U >, Vec < U :: Output > ) ;
readable_collection ! ( U => std :: collections :: VecDeque < U >, std :: collections :: VecDeque < U :: Output > ) ;
readable_collection ! ( U : Eq , std :: hash :: Hash => std :: collections :: HashSet < U >, std :: collections :: HashSet < U :: Output > ) ;
readable_collection ! ( U : Ord => std :: collections :: BTreeSet < U >, std :: collections :: BTreeSet < U :: Output > ) ;
readable_collection ! ( U : Ord => std :: collections :: BinaryHeap < U >, std :: collections :: BinaryHeap < U :: Output > ) ;
pub fn read<T: ReadableFromLine>() -> T::Output {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    T::read_line(&line).unwrap()
}
#[macro_export]
macro_rules ! read { ( ) => { let mut line = String :: new ( ) ; std :: io :: stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; } ; ( $ pat : pat = $ t : ty ) => { let $ pat = read ::<$ t > ( ) ; } ; ( $ ( $ pat : pat = $ t : ty ) ,+ ) => { read ! ( ( $ ( $ pat ) ,* ) = ( $ ( $ t ) ,* ) ) ; } ; }
#[macro_export]
macro_rules ! readls { ( $ ( $ pat : pat = $ t : ty ) ,+ ) => { $ ( read ! ( $ pat = $ t ) ; ) * } ; }
pub fn readx<T: ReadableFromLine>() -> Vec<T::Output> {
    use std::io::{self, BufRead};
    let stdin = io::stdin();
    let result = stdin
        .lock()
        .lines()
        .map(|line_result| {
            let line = line_result.expect("read from stdin failed");
            T::read_line(&line).unwrap()
        })
        .collect();
    result
}
#[macro_export]
macro_rules ! readx_loop { ( |$ pat : pat = $ t : ty | $ body : expr ) => { { use std :: io :: BufRead ; let stdin = std :: io :: stdin ( ) ; for line in stdin . lock ( ) . lines ( ) { let line = line . expect ( "read from stdin failed" ) ; let $ pat = <$ t >:: read_line ( & line ) . unwrap ( ) ; $ body } } } ; ( |$ ( $ pat : pat = $ t : ty ) ,*| $ body : expr ) => { readx_loop ! ( | ( $ ( $ pat ) ,* ) = ( $ ( $ t ) ,* ) | $ body ) ; } ; }
pub fn readn<T: ReadableFromLine>(n: usize) -> Vec<T::Output> {
    use std::io::{self, BufRead};
    let stdin = io::stdin();
    let result: Vec<T::Output> = stdin
        .lock()
        .lines()
        .take(n)
        .map(|line_result| {
            let line = line_result.expect("read from stdin failed");
            T::read_line(&line).unwrap()
        })
        .collect();
    if result.len() < n {
        panic!(
            "expected reading {} lines, but only {} lines are read",
            n,
            result.len()
        );
    }
    result
}
#[macro_export]
macro_rules ! readn_loop { ( $ n : expr , |$ pat : pat = $ t : ty | $ body : expr ) => { { use std :: io :: BufRead ; let stdin = std :: io :: stdin ( ) ; let mut lock = stdin . lock ( ) ; for _ in 0 ..$ n { let mut line = String :: new ( ) ; lock . read_line ( & mut line ) . expect ( "read from stdin failed" ) ; let $ pat = <$ t >:: read_line ( & line ) . unwrap ( ) ; $ body } } } ; ( $ n : expr , |$ ( $ pat : pat = $ t : ty ) ,*| $ body : expr ) => { readn_loop ! ( $ n , | ( $ ( $ pat ) ,* ) = ( $ ( $ t ) ,* ) | $ body ) ; } ; }
pub trait Words {
    fn read<T: Readable>(&self) -> T::Output;
}
impl<'a> Words for [&'a str] {
    fn read<T: Readable>(&self) -> T::Output {
        T::read_words(self).unwrap()
    }
}
impl<'a> Words for &'a str {
    fn read<T: Readable>(&self) -> T::Output {
        T::read_words(&[self]).unwrap()
    }
}

macro_rules! forward_ref_unop {
    ( impl $ op : ident , $ method : ident for $ t : ty ) => {
        impl std::ops::$op for &$t {
            type Output = <$t as std::ops::$op>::Output;
            fn $method(self) -> <$t as std::ops::$op>::Output {
                std::ops::$op::$method(*self)
            }
        }
    };
}
macro_rules! forward_ref_binop {
    ( impl $ op : ident , $ method : ident for $ t : ty , $ u : ty ) => {
        impl<'a> std::ops::$op<$u> for &'a $t {
            type Output = <$t as std::ops::$op<$u>>::Output;
            fn $method(self, other: $u) -> <$t as std::ops::$op<$u>>::Output {
                std::ops::$op::$method(*self, other)
            }
        }
        impl std::ops::$op<&$u> for $t {
            type Output = <$t as std::ops::$op<$u>>::Output;
            fn $method(self, other: &$u) -> <$t as std::ops::$op<$u>>::Output {
                std::ops::$op::$method(self, *other)
            }
        }
        impl std::ops::$op<&$u> for &$t {
            type Output = <$t as std::ops::$op<$u>>::Output;
            fn $method(self, other: &$u) -> <$t as std::ops::$op<$u>>::Output {
                std::ops::$op::$method(*self, *other)
            }
        }
    };
}
macro_rules! forward_ref_op_assign {
    ( impl $ op : ident , $ method : ident for $ t : ty , $ u : ty ) => {
        impl std::ops::$op<&$u> for $t {
            fn $method(&mut self, other: &$u) {
                std::ops::$op::$method(self, *other);
            }
        }
    };
}
pub trait PrimitiveInteger:
Sized
    + Ord
    + std::ops::Add<Output = Self>
    + std::ops::Sub<Output = Self>
    + std::ops::Div<Output = Self>
{
    fn one() -> Self;
    fn abs_diff(self, rhs: Self) -> Self;
    fn rem_euclid(self, rhs: Self) -> Self;
}
macro_rules ! impl_primitive_integer { ( $ ( $ t : ty ) * ) => { $ ( impl PrimitiveInteger for $ t { fn one ( ) -> $ t { 1 } fn abs_diff ( self , rhs : $ t ) -> $ t { if self < rhs { rhs - self } else { self - rhs } } # [ allow ( unused_comparisons ) ] fn rem_euclid ( self , rhs : $ t ) -> $ t { let r = self % rhs ; if r < 0 { if rhs < 0 { r - rhs } else { r + rhs } } else { r } } } ) * } }
impl_primitive_integer ! ( u8 u16 u32 u64 usize i8 i16 i32 i64 isize ) ;
pub trait PrimitiveUnsigned: PrimitiveInteger {
    fn ceil_div(self, rhs: Self) -> Self;
    fn round_div(self, rhs: Self) -> Self;
    fn log2(self) -> Option<Self>;
    fn ceil_log2(self) -> Option<Self>;
    fn sqrt(self) -> Self;
}
macro_rules ! impl_primitive_unsigned { ( $ ( $ t : ty ) * ) => { $ ( impl PrimitiveUnsigned for $ t { fn ceil_div ( self , rhs : $ t ) -> $ t { ( self + rhs - 1 ) / rhs } fn round_div ( self , rhs : $ t ) -> $ t { ( self + rhs / 2 ) / rhs } fn log2 ( mut self ) -> Option <$ t > { if self == 0 { None } else { let mut ans = 0 ; while self > 1 { ans += 1 ; self /= 2 ; } Some ( ans ) } } fn ceil_log2 ( self ) -> Option <$ t > { self . log2 ( ) . map ( | x | { ( self + ( ( 1 << x ) - 1 ) ) . log2 ( ) . unwrap ( ) } ) } fn sqrt ( self ) -> $ t { ( self as f64 ) . sqrt ( ) as $ t } } ) * } }
impl_primitive_unsigned ! ( u8 u16 u32 u64 usize ) ;
pub fn gcd(a: u64, b: u64) -> u64 {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}
pub fn bezout(a: i64, b: i64) -> (i64, i64, u64) {
    let (x, y, g) = bezout_sub((a * a.signum()) as u64, (b * b.signum()) as u64);
    (x * a.signum(), y * b.signum(), g)
}
fn bezout_sub(a: u64, b: u64) -> (i64, i64, u64) {
    if b == 0 {
        (1, 0, a)
    } else {
        let m = (a / b) as i64;
        let (x, y, g) = bezout_sub(b, a % b);
        (y, x - m * y, g)
    }
}

fn divs(n: u64) -> Vec<u64> {
    let mut res = Vec::new();
    for d in 2..((n as f64).sqrt() as u64)+1 {
        if n % d == 0 {
            res.push(d);
            if n != d*d {
                res.push(n / d);
            }
        }
    }
    res
}

fn main() {
    read!(n = u64);
    let ans = divs(n).into_iter().fold(n, |acc, d| gcd(acc, d));
    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"),
            )+
        )
    })
}

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

use std::io::Write;

fn solve(writer: &mut std::io::BufWriter<std::io::Stdout>) {
    let mut n = parse_line!(u64);
    let mut primes = Vec::new();
    for i in 2..n {
        if i * i > n {
            break;
        }
        if n % i != 0 {
            continue;
        }
        n /= i;
        while n % i == 0 {
            n /= i;
        }
        primes.push(i);
    }
    if n != 1 {
        primes.push(n);
    }
    if primes.len() == 1 {
        writeln!(writer, "{}", primes[0]).unwrap();
    }else{
        writeln!(writer, "1").unwrap();
    }
}

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

use std::io::stdin;
use std::collections::{HashSet, BTreeSet};

macro_rules! readln {
        () => {{ let mut line = String::new(); stdin().read_line(&mut line).unwrap(); line }};
        ($type:ty) => {{ readln!().split_whitespace().next().unwrap().parse::<$type>().unwrap() }};
        (|$type_vec:ty|) => {{ readln!().split_whitespace().map(|it| it.parse().unwrap()).collect::<Vec<$type_vec>>() }};
        ($($type:ty),*) => {{ let line = readln!(); let mut iter = line.split_whitespace(); ($(iter.next().unwrap().parse::<$type>().unwrap(),)*) }};
        ($($type:ty),*, |$type_vec:ty|) => {{ let line = readln!(); let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$type>().unwrap(),)*iter.map(|it| it.parse().unwrap()).collect::<Vec<$type_vec>>(),)}};
}

fn re2(mut n: u64) -> BTreeSet<u64> {
    let mut res = BTreeSet::new();
    let mut mb = BTreeSet::new();
    let copy = n;
    let mut i = 2;
    while n != 1 && i * i <= copy && res.len() != 2 {
        if n % i == 0 {
            n /= i;
            res.insert(i);
            mb.insert(copy / i);
        } else {
            i += 1;
        }
    }
    mb.insert(n);
    res.remove(&1);
    if res.len() == 2 {
        return res;
    }
    mb.iter().for_each(|it| {
        let mut flag = true;
        for j in res.iter() {
            if *it % *j == 0 {
                flag = false;
            }
        }
        if flag {
            res.insert(*it);
        }
    });
    res.remove(&1);
    if res.is_empty() {
        res.insert(copy);
        return res;
    }

    res
}

fn main() {
    let mut n = readln!(u64);

    let res = re2(n);

    if res.is_empty() {
        println!("{}", n);
    } else if res.len() == 1 {
        println!("{}", res.iter().next().unwrap());
    } else {
        println!("1")
    }
}

#![allow(unused_imports)]
#![allow(non_snake_case, unused)]

use std::cmp::*;
use std::collections::*;
use std::ops::*;

macro_rules! eprint {
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = write!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! eprintln {
	() => { eprintln!(""); };
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = writeln!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! dbg {
	($v:expr) => {{
		let val = $v;
		eprintln!("[{}:{}] {} = {:?}", file!(), line!(), stringify!($v), val);
		val
	}}
}

macro_rules! mat {
	($($e:expr),*) => { Vec::from(vec![$($e),*]) };
	($($e:expr,)*) => { Vec::from(vec![$($e),*]) };
	($e:expr; $d:expr) => { Vec::from(vec![$e; $d]) };
	($e:expr; $d:expr $(; $ds:expr)+) => { Vec::from(vec![mat![$e $(; $ds)*]; $d]) };
}

macro_rules! ok {
	($a:ident$([$i:expr])*.$f:ident()$(@$t:ident)*) => {
		$a$([$i])*.$f($($t),*)
	};
	($a:ident$([$i:expr])*.$f:ident($e:expr$(,$es:expr)*)$(@$t:ident)*) => { {
		let t = $e;
		ok!($a$([$i])*.$f($($es),*)$(@$t)*@t)
	} };
}

pub fn readln() -> String {
	let mut line = String::new();
	::std::io::stdin().read_line(&mut line).unwrap_or_else(|e| panic!("{}", e));
	line
}

macro_rules! read {
	($($t:tt),*; $n:expr) => {{
		let stdin = ::std::io::stdin();
		let ret = ::std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
			let line = line.unwrap();
			let mut it = line.split_whitespace();
			_read!(it; $($t),*)
		}).collect::<Vec<_>>();
		ret
	}};
	($($t:tt),*) => {{
		let line = readln();
		let mut it = line.split_whitespace();
		_read!(it; $($t),*)
	}};
}

macro_rules! _read {
	($it:ident; [char]) => {
		_read!($it; String).chars().collect::<Vec<_>>()
	};
	($it:ident; [u8]) => {
		Vec::from(_read!($it; String).into_bytes())
	};
	($it:ident; usize1) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1
	};
	($it:ident; [usize1]) => {
		$it.map(|s| s.parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1).collect::<Vec<_>>()
	};
	($it:ident; [$t:ty]) => {
		$it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
	};
	($it:ident; $t:ty) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
	};
	($it:ident; $($t:tt),+) => {
		($(_read!($it; $t)),*)
	};
}

pub fn main() {
	let _ = ::std::thread::Builder::new().name("run".to_string()).stack_size(32 * 1024 * 1024).spawn(run).unwrap().join();
}

const MOD: u32 = 1_000_000_007;
const INF: i64 = std::i64::MAX;

pub trait SetMinMax {
	fn setmin(&mut self, v: Self) -> bool;
	fn setmax(&mut self, v: Self) -> bool;
}
impl<T> SetMinMax for T where T: PartialOrd {
	fn setmin(&mut self, v: T) -> bool {
		*self > v && { *self = v; true }
	}
	fn setmax(&mut self, v: T) -> bool {
		*self < v && { *self = v; true }
	}
}

use std::cmp::Ordering;

/// Equivalent to std::lowerbound and std::upperbound in c++
pub trait BinarySearch<T> {
    fn lower_bound(&self, x: &T) -> usize;
    fn upper_bound(&self, x: &T) -> usize;
}

impl<T: Ord> BinarySearch<T> for [T] {
    // 配列a内のv以上の最小のindex
    fn lower_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less => {
                    low = mid + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
    // 配列a内のvより大きいの最小のindex
    fn upper_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less | Ordering::Equal => {
                    low = mid + 1;
                }
                Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
}

fn swap(a: usize, b: usize, sv: &mut [char], tv: &mut [char]) {
	let tmp = sv[a];
	sv[a] = tv[b];
	tv[b] = tmp;
}

fn solve() {
	let n = read!(i64);
	let mut sum = 0;
	let mut v = vec![];
	if n==1 {
		println!("{}", 1);
		return;
	}
	for i in 2..((n as f64).sqrt() as i64+1) {
		if n%i==0 {
			sum+=2;
			v.push(i);
			v.push(n/i);
		}
	}
	if sum==0 {
		println!("{}", n);
		return;
	}
	let mi = v[0];
	let mut flag = true;
	for &i in &v {
		if i%mi!=0 {flag=false;}
	}
	if !flag {println!("{}", 1);}
	else{ println!("{}", mi);}

}

fn run() {
    solve();
}

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

#[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! 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),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn gcd(a: i64, b: i64) -> i64 {
    if b == 0 {
        a
    } else {
        gcd(b, a%b)
    }
}

fn main() {
    input! {
        n: i64
    };

    let mut ans = n;
    for i in 1..n+1 {
        if i * i > n {
            break;
        }
        if n % i == 0 {
            if i >= 2 {
                ans = gcd(ans, i);
            }
            if n/i >= 2 {
                ans = gcd(ans, n/i);
            }
        }
    }
    println!("{}", ans);
}

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

macro_rules! readln {
        () => {{ let mut line = String::new(); stdin().read_line(&mut line).unwrap(); line }};
        ($type:ty) => {{ readln!().split_whitespace().next().unwrap().parse::<$type>().unwrap() }};
        (|$type_vec:ty|) => {{ readln!().split_whitespace().map(|it| it.parse().unwrap()).collect::<Vec<$type_vec>>() }};
        ($($type:ty),*) => {{ let line = readln!(); let mut iter = line.split_whitespace(); ($(iter.next().unwrap().parse::<$type>().unwrap(),)*) }};
        ($($type:ty),*, |$type_vec:ty|) => {{ let line = readln!(); let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$type>().unwrap(),)*iter.map(|it| it.parse().unwrap()).collect::<Vec<$type_vec>>(),)}};
}

fn main() {
    let mut n = readln!(u64);

    let mut res = HashSet::new();

    let copy = n;
    let mut i = 2;
    while n != 1 && i * i <= copy {
        if n % i == 0 {
            n /= i;
            res.insert(i);
            res.insert(copy / i);
            if res.len() == 2 {
                break;
            }
        } else {
            i += 1;
        }
    }
    res.remove(&1);

    if res.is_empty() {
        println!("{}", n);
    } else if res.len() == 1 {
        println!("{}", res.iter().next().unwrap());
    } else {
        println!("1")
    }
}

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

macro_rules! readln {
        () => {{ let mut line = String::new(); stdin().read_line(&mut line).unwrap(); line }};
        ($type:ty) => {{ readln!().split_whitespace().next().unwrap().parse::<$type>().unwrap() }};
        (|$type_vec:ty|) => {{ readln!().split_whitespace().map(|it| it.parse().unwrap()).collect::<Vec<$type_vec>>() }};
        ($($type:ty),*) => {{ let line = readln!(); let mut iter = line.split_whitespace(); ($(iter.next().unwrap().parse::<$type>().unwrap(),)*) }};
        ($($type:ty),*, |$type_vec:ty|) => {{ let line = readln!(); let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$type>().unwrap(),)*iter.map(|it| it.parse().unwrap()).collect::<Vec<$type_vec>>(),)}};
}

fn division(n: u64) -> HashSet<u64> {
    let mut res = HashSet::new();

    if n % 2 == 0 {
        res.insert(2);
        res.insert(n / 2);
    }
    let mut i = 3;
    while i * i <= n {
        if n % i == 0 {
            res.insert(i);
        }
        i += 2;
    }
    res.remove(&1);
    res
}

fn main() {
    let n = readln!(u64);
    let divisions = division(n);

    if divisions.is_empty() {
        println!("{}", n);
    } else if divisions.len() == 1 {
        println!("{}", divisions.iter().next().unwrap());
    } else {
        println!("1")
    }
}

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

macro_rules! readln {
        () => {{ let mut line = String::new(); stdin().read_line(&mut line).unwrap(); line }};
        ($type:ty) => {{ readln!().split_whitespace().next().unwrap().parse::<$type>().unwrap() }};
        (|$type_vec:ty|) => {{ readln!().split_whitespace().map(|it| it.parse().unwrap()).collect::<Vec<$type_vec>>() }};
        ($($type:ty),*) => {{ let line = readln!(); let mut iter = line.split_whitespace(); ($(iter.next().unwrap().parse::<$type>().unwrap(),)*) }};
        ($($type:ty),*, |$type_vec:ty|) => {{ let line = readln!(); let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$type>().unwrap(),)*iter.map(|it| it.parse().unwrap()).collect::<Vec<$type_vec>>(),)}};
}

fn division(n: u64) -> HashSet<u64> {
    let mut res = HashSet::new();

    if n % 2 == 0 {
        res.insert(2);
        res.insert(n / 2);
    }
    let mut i = 3;
    while i * i <= n {
        if n % i == 0 {
            res.insert(i);
        }
        i += 2;
    }
    res
}

fn main() {
    let n = readln!(u64);
    let divisions = division(n);

    if divisions.is_empty() {
        println!("{}", n);
    } else if divisions.len() == 1 {
        println!("{}", divisions.iter().next().unwrap());
    } else {
        println!("1")
    }
}

#![allow(unused_imports)]
#![allow(non_snake_case, unused)]

use std::cmp::*;
use std::collections::*;
use std::ops::*;

macro_rules! eprint {
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = write!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! eprintln {
	() => { eprintln!(""); };
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = writeln!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! dbg {
	($v:expr) => {{
		let val = $v;
		eprintln!("[{}:{}] {} = {:?}", file!(), line!(), stringify!($v), val);
		val
	}}
}

macro_rules! mat {
	($($e:expr),*) => { Vec::from(vec![$($e),*]) };
	($($e:expr,)*) => { Vec::from(vec![$($e),*]) };
	($e:expr; $d:expr) => { Vec::from(vec![$e; $d]) };
	($e:expr; $d:expr $(; $ds:expr)+) => { Vec::from(vec![mat![$e $(; $ds)*]; $d]) };
}

macro_rules! ok {
	($a:ident$([$i:expr])*.$f:ident()$(@$t:ident)*) => {
		$a$([$i])*.$f($($t),*)
	};
	($a:ident$([$i:expr])*.$f:ident($e:expr$(,$es:expr)*)$(@$t:ident)*) => { {
		let t = $e;
		ok!($a$([$i])*.$f($($es),*)$(@$t)*@t)
	} };
}

pub fn readln() -> String {
	let mut line = String::new();
	::std::io::stdin().read_line(&mut line).unwrap_or_else(|e| panic!("{}", e));
	line
}

macro_rules! read {
	($($t:tt),*; $n:expr) => {{
		let stdin = ::std::io::stdin();
		let ret = ::std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
			let line = line.unwrap();
			let mut it = line.split_whitespace();
			_read!(it; $($t),*)
		}).collect::<Vec<_>>();
		ret
	}};
	($($t:tt),*) => {{
		let line = readln();
		let mut it = line.split_whitespace();
		_read!(it; $($t),*)
	}};
}

macro_rules! _read {
	($it:ident; [char]) => {
		_read!($it; String).chars().collect::<Vec<_>>()
	};
	($it:ident; [u8]) => {
		Vec::from(_read!($it; String).into_bytes())
	};
	($it:ident; usize1) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1
	};
	($it:ident; [usize1]) => {
		$it.map(|s| s.parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1).collect::<Vec<_>>()
	};
	($it:ident; [$t:ty]) => {
		$it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
	};
	($it:ident; $t:ty) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
	};
	($it:ident; $($t:tt),+) => {
		($(_read!($it; $t)),*)
	};
}

pub fn main() {
	let _ = ::std::thread::Builder::new().name("run".to_string()).stack_size(32 * 1024 * 1024).spawn(run).unwrap().join();
}

const MOD: u32 = 1_000_000_007;
const INF: i64 = std::i64::MAX;

pub trait SetMinMax {
	fn setmin(&mut self, v: Self) -> bool;
	fn setmax(&mut self, v: Self) -> bool;
}
impl<T> SetMinMax for T where T: PartialOrd {
	fn setmin(&mut self, v: T) -> bool {
		*self > v && { *self = v; true }
	}
	fn setmax(&mut self, v: T) -> bool {
		*self < v && { *self = v; true }
	}
}

use std::cmp::Ordering;

/// Equivalent to std::lowerbound and std::upperbound in c++
pub trait BinarySearch<T> {
    fn lower_bound(&self, x: &T) -> usize;
    fn upper_bound(&self, x: &T) -> usize;
}

impl<T: Ord> BinarySearch<T> for [T] {
    // 配列a内のv以上の最小のindex
    fn lower_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less => {
                    low = mid + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
    // 配列a内のvより大きいの最小のindex
    fn upper_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less | Ordering::Equal => {
                    low = mid + 1;
                }
                Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
}

fn swap(a: usize, b: usize, sv: &mut [char], tv: &mut [char]) {
	let tmp = sv[a];
	sv[a] = tv[b];
	tv[b] = tmp;
}

fn solve() {
	let n = read!(i64);
	let mut sum = 0;
	let mut v = vec![];
	for i in 2..1000001 {
		if n%i==0 {
			sum+=1;
			v.push(i);
		}
	}
	if sum==1 {
		println!("{}", n);
		return;
	}
	let mi = v[0];
	let mut flag = true;
	for &i in &v {
		if i%mi!=0 {flag=false;}
	}
	if !flag {println!("{}", 1);}
	else{ println!("{}", mi);}

}

fn run() {
    solve();
}

#![allow(unused_imports)]
#![allow(non_snake_case, unused)]

use std::cmp::*;
use std::collections::*;
use std::ops::*;

macro_rules! eprint {
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = write!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! eprintln {
	() => { eprintln!(""); };
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = writeln!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! dbg {
	($v:expr) => {{
		let val = $v;
		eprintln!("[{}:{}] {} = {:?}", file!(), line!(), stringify!($v), val);
		val
	}}
}

macro_rules! mat {
	($($e:expr),*) => { Vec::from(vec![$($e),*]) };
	($($e:expr,)*) => { Vec::from(vec![$($e),*]) };
	($e:expr; $d:expr) => { Vec::from(vec![$e; $d]) };
	($e:expr; $d:expr $(; $ds:expr)+) => { Vec::from(vec![mat![$e $(; $ds)*]; $d]) };
}

macro_rules! ok {
	($a:ident$([$i:expr])*.$f:ident()$(@$t:ident)*) => {
		$a$([$i])*.$f($($t),*)
	};
	($a:ident$([$i:expr])*.$f:ident($e:expr$(,$es:expr)*)$(@$t:ident)*) => { {
		let t = $e;
		ok!($a$([$i])*.$f($($es),*)$(@$t)*@t)
	} };
}

pub fn readln() -> String {
	let mut line = String::new();
	::std::io::stdin().read_line(&mut line).unwrap_or_else(|e| panic!("{}", e));
	line
}

macro_rules! read {
	($($t:tt),*; $n:expr) => {{
		let stdin = ::std::io::stdin();
		let ret = ::std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
			let line = line.unwrap();
			let mut it = line.split_whitespace();
			_read!(it; $($t),*)
		}).collect::<Vec<_>>();
		ret
	}};
	($($t:tt),*) => {{
		let line = readln();
		let mut it = line.split_whitespace();
		_read!(it; $($t),*)
	}};
}

macro_rules! _read {
	($it:ident; [char]) => {
		_read!($it; String).chars().collect::<Vec<_>>()
	};
	($it:ident; [u8]) => {
		Vec::from(_read!($it; String).into_bytes())
	};
	($it:ident; usize1) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1
	};
	($it:ident; [usize1]) => {
		$it.map(|s| s.parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1).collect::<Vec<_>>()
	};
	($it:ident; [$t:ty]) => {
		$it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
	};
	($it:ident; $t:ty) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
	};
	($it:ident; $($t:tt),+) => {
		($(_read!($it; $t)),*)
	};
}

pub fn main() {
	let _ = ::std::thread::Builder::new().name("run".to_string()).stack_size(32 * 1024 * 1024).spawn(run).unwrap().join();
}

const MOD: u32 = 1_000_000_007;
const INF: i64 = std::i64::MAX;

pub trait SetMinMax {
	fn setmin(&mut self, v: Self) -> bool;
	fn setmax(&mut self, v: Self) -> bool;
}
impl<T> SetMinMax for T where T: PartialOrd {
	fn setmin(&mut self, v: T) -> bool {
		*self > v && { *self = v; true }
	}
	fn setmax(&mut self, v: T) -> bool {
		*self < v && { *self = v; true }
	}
}

use std::cmp::Ordering;

/// Equivalent to std::lowerbound and std::upperbound in c++
pub trait BinarySearch<T> {
    fn lower_bound(&self, x: &T) -> usize;
    fn upper_bound(&self, x: &T) -> usize;
}

impl<T: Ord> BinarySearch<T> for [T] {
    // 配列a内のv以上の最小のindex
    fn lower_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less => {
                    low = mid + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
    // 配列a内のvより大きいの最小のindex
    fn upper_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less | Ordering::Equal => {
                    low = mid + 1;
                }
                Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
}

fn swap(a: usize, b: usize, sv: &mut [char], tv: &mut [char]) {
	let tmp = sv[a];
	sv[a] = tv[b];
	tv[b] = tmp;
}

fn solve() {
	let n = read!(i64);
	let mut sum = 0;
	let mut v = vec![];
	if n==1 {
		println!("{}", 1);
		return;
	}
	for i in 2..((n as f64).sqrt() as i64+1) {
		if n%i==0 {
			sum+=2;
			v.push(i);
			v.push(n%i);
		}
	}
	if sum==0 {
		println!("{}", n);
		return;
	}
	let mi = v[0];
	let mut flag = true;
	for &i in &v {
		if i%mi!=0 {flag=false;}
	}
	if !flag {println!("{}", 1);}
	else{ println!("{}", mi);}

}

fn run() {
    solve();
}

#![allow(unused_imports)]
#![allow(non_snake_case, unused)]

use std::cmp::*;
use std::collections::*;
use std::ops::*;

macro_rules! eprint {
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = write!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! eprintln {
	() => { eprintln!(""); };
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = writeln!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! dbg {
	($v:expr) => {{
		let val = $v;
		eprintln!("[{}:{}] {} = {:?}", file!(), line!(), stringify!($v), val);
		val
	}}
}

macro_rules! mat {
	($($e:expr),*) => { Vec::from(vec![$($e),*]) };
	($($e:expr,)*) => { Vec::from(vec![$($e),*]) };
	($e:expr; $d:expr) => { Vec::from(vec![$e; $d]) };
	($e:expr; $d:expr $(; $ds:expr)+) => { Vec::from(vec![mat![$e $(; $ds)*]; $d]) };
}

macro_rules! ok {
	($a:ident$([$i:expr])*.$f:ident()$(@$t:ident)*) => {
		$a$([$i])*.$f($($t),*)
	};
	($a:ident$([$i:expr])*.$f:ident($e:expr$(,$es:expr)*)$(@$t:ident)*) => { {
		let t = $e;
		ok!($a$([$i])*.$f($($es),*)$(@$t)*@t)
	} };
}

pub fn readln() -> String {
	let mut line = String::new();
	::std::io::stdin().read_line(&mut line).unwrap_or_else(|e| panic!("{}", e));
	line
}

macro_rules! read {
	($($t:tt),*; $n:expr) => {{
		let stdin = ::std::io::stdin();
		let ret = ::std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
			let line = line.unwrap();
			let mut it = line.split_whitespace();
			_read!(it; $($t),*)
		}).collect::<Vec<_>>();
		ret
	}};
	($($t:tt),*) => {{
		let line = readln();
		let mut it = line.split_whitespace();
		_read!(it; $($t),*)
	}};
}

macro_rules! _read {
	($it:ident; [char]) => {
		_read!($it; String).chars().collect::<Vec<_>>()
	};
	($it:ident; [u8]) => {
		Vec::from(_read!($it; String).into_bytes())
	};
	($it:ident; usize1) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1
	};
	($it:ident; [usize1]) => {
		$it.map(|s| s.parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1).collect::<Vec<_>>()
	};
	($it:ident; [$t:ty]) => {
		$it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
	};
	($it:ident; $t:ty) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
	};
	($it:ident; $($t:tt),+) => {
		($(_read!($it; $t)),*)
	};
}

pub fn main() {
	let _ = ::std::thread::Builder::new().name("run".to_string()).stack_size(32 * 1024 * 1024).spawn(run).unwrap().join();
}

const MOD: u32 = 1_000_000_007;
const INF: i64 = std::i64::MAX;

pub trait SetMinMax {
	fn setmin(&mut self, v: Self) -> bool;
	fn setmax(&mut self, v: Self) -> bool;
}
impl<T> SetMinMax for T where T: PartialOrd {
	fn setmin(&mut self, v: T) -> bool {
		*self > v && { *self = v; true }
	}
	fn setmax(&mut self, v: T) -> bool {
		*self < v && { *self = v; true }
	}
}

use std::cmp::Ordering;

/// Equivalent to std::lowerbound and std::upperbound in c++
pub trait BinarySearch<T> {
    fn lower_bound(&self, x: &T) -> usize;
    fn upper_bound(&self, x: &T) -> usize;
}

impl<T: Ord> BinarySearch<T> for [T] {
    // 配列a内のv以上の最小のindex
    fn lower_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less => {
                    low = mid + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
    // 配列a内のvより大きいの最小のindex
    fn upper_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less | Ordering::Equal => {
                    low = mid + 1;
                }
                Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
}

fn swap(a: usize, b: usize, sv: &mut [char], tv: &mut [char]) {
	let tmp = sv[a];
	sv[a] = tv[b];
	tv[b] = tmp;
}

fn solve() {
	let n = read!(i64);
	let mut sum = 0;
	let mut v = vec![];
	if n==1 {
		println!("{}", 1);
		return;
	}
	for i in 2..1000001 {
		if n%i==0 {
			sum+=1;
			v.push(i);
		}
	}
	if sum==1 {
		println!("{}", n);
		return;
	}
	let mi = v[0];
	let mut flag = true;
	for &i in &v {
		if i%mi!=0 {flag=false;}
	}
	if !flag {println!("{}", 1);}
	else{ println!("{}", mi);}

}

fn run() {
    solve();
}