import math a=20*30/math.gcd(20,30) #lcm计算最小公倍数 b=1000//a c=1000%a if c<=20: print(int(b*20+c)) else: print(int(b*20+20))