using static System.Console; using System.Linq; namespace App { class Prog { static void Main() { var x = ReadLine().Split().ToArray(); if (x[1] == "?") { WriteLine("14"); return; } WriteLine((x[0] == "2" || x[2] == "2") ? "1" : "4"); } } }