use std::io::Read; use std::cmp::{max, min}; fn gcd(a: u128, b: u128) -> u128 { if a % b == 0 { return b; } gcd(b, a % b) } fn main() { let mut tab = String::new(); std::io::stdin().read_to_string(&mut tab).ok(); let tab: Vec = tab.trim().split('\n').next().unwrap().trim().split_whitespace() .map(|s| s.parse().unwrap()) .collect(); let t = tab[0]; let a = tab[1]; let b = tab[2]; let gcd = gcd(max(a, b), min(a, b)); let lcm = a * b / gcd ; let a_count = 1 + t / a - if t % a == 0 { 1 } else { 0 }; let b_count = 1 + t / b - if t % b == 0 { 1 } else { 0 }; let lcm_count = 1 + t / lcm - if t % lcm == 0 { 1 } else { 0 }; println!("{}", a_count + b_count - lcm_count); }