use std::io::{self, Read}; fn main() { let mut y = String::new(); io::stdin().read_to_string(&mut y).ok(); let y = y.trim().parse::().unwrap(); println!("{}", 2017 - y); }