a, b, c = map(int, input().split()) d = a+b-1 print(c//d*a + min(a, c%d))