def isok(a) return false if a[0]==a[2] (a[1]a[0]&&a[1]>a[2]) end a=gets.split.map(&:to_i) puts isok(a) ? :INF : (1..1e3).count{|i|isok(a.map{|e|e%i})}