fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let s = s.trim(); println!("{}", 9 * (1 + s.len())) }