fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let n: u64 = s.trim().parse().unwrap(); println!("{}", n.min(6) + n.saturating_sub(6) * 7); }