fn main () { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); println!("{}", if n == 1 { 1491 } else if n == 2 { 10947 } else { 841341 }); }