c=gets.split q=c.index('?') t=c.index('2') if q==1 puts "14" else puts q == 0 && t == 1 || q == 2 && t == 1 ? 4 : 1 end