nn = int(input()) 
widh = int(input()) 
sqar = int(input()) 
ans = 0 
lift = 0 
rigt = 0 
d = 1 
while d * d <= sqar: 
 if sqar % d == 0: 
    a = d 
    b = sqar // d 
    ans = max (nn//a * (widh//b),nn//b * (widh//a)) 
 if ans == nn//a * (widh//b): 
    lift, rigt = nn//a, widh//b 
 if ans == nn//b * (widh//a): 
    lift, rigt = nn//b, widh//a 
    d = d + 1 
print(ans)