fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    println!("{}", if s.trim().len() == 3 {s.chars().filter(|&c| c != ' ').fold(1, |p, x| p * (x as i8 - '0' as i8))} else { -1 });
}