m, d = gets.chomp.split.map{|e| e.to_i} if m > 8 puts 24 elsif m == 8 && d >= 22 puts 24 else puts 23 end