# yukicoder No.358 も~っと!門松列 2020/01/31 a=list(map(int,input().split())) if a[0]==a[1] or a[1]==a[2] or a[0]==a[2]: print(0) exit() if a[0]a[1] and a[2]>a[1]: if a[0]!=a[2]: print('INF') exit() mx=max(a)+1 cnt=0 for i in range(1,mx): a1=a[0]%i a2=a[1]%i a3=a[2]%i if a1a2 and a3>a2: if a1==a3:continue cnt+=1 print(mx)