import sys a, b, c = map(int, sys.stdin.readline().split()) print(c//(a+b-1)*a + min(a, c%(a+b-1)))