def is_ok_1 c1, c2, c3 if c1 == 0 c1 = 1 elsif c2 == 0 c2 = 1 else c3 = 1 end if c1 == c2 or c2 == c3 or c3 == c1 return false end if [c1, c2, c3].max == c2 or [c1, c2, c3].min == c2 return true else return false end end def is_ok_4 c1, c2, c3 if c1 == 0 c1 = 4 elsif c2 == 0 c2 = 4 else c3 = 4 end if c1 == c2 or c2 == c3 or c3 == c1 return false end if [c1, c2, c3].max == c2 or [c1, c2, c3].min == c2 return true else return false end end c1, c2, c3 = gets.chomp.split.map &:to_i if is_ok_1(c1, c2, c3) print 1 end if is_ok_4(c1, c2, c3) print 4 end puts