use std::io; use std::str::FromStr; fn main() { let stdin = io::stdin(); let mut buf = String::new(); stdin.read_line(&mut buf).ok(); let mut it = buf.split_whitespace().map(|n| u64::from_str(n).unwrap()); let a = it.next().unwrap(); let mut buf = String::new(); stdin.read_line(&mut buf).ok(); let mut it = buf.split_whitespace().map(|n| u64::from_str(n).unwrap()); let b = it.next().unwrap(); let d = a / b; if d < 1000 { println!("{}", 0); return; } println!("{}", d - d % 1000); }