from math import log2,floor,ceil x,y,h = map(int,input().split()) x *= 1000 y *= 1000 l = ceil(log2(x/h)) r = ceil(log2(y/h)) lup = floor(log2(x/h)+2) rup = floor(log2(y/h)+2) lis1 = [i for i in range(l,lup+1)] lis2 = [i for i in range(r,rup+1)] ans = 0 for p in lis1: for q in lis2: a = 2*p-q b = 2*q-p if a%3!=0 or b%3 != 0:continue else: a //=3;b//=3 if a >= 0 and b >= 0: ans = max(ans,a+b) print(ans)