# frozen_string_literal: true M, D = gets.chomp.split.map(&:to_i) RESULT = M == 4 && D == 1 ? 0 : M + D puts RESULT