tick, treat = gets.split(" ").map{|s| s.to_i} puts (1..(tick | treat)).inject(1,:*)