e=lambda a,b,c,d:a%d==b%d or b%d==c%d or a%d==c%d a,b,c=map(int,input().split()) if e(a,b,c,10**10):print(0) elif max(a,b,c)==b or min(a,b,c)==b:print('INF') else: d=0 for i in range(1,max(a,b,c)+1): if not e(a,b,c,i) and (max(a%i,b%i,c%i)==b%i or min(a%i,b%i,c%i)==b%i):d+=1 print(d)