X, Y, Z = map(int, input().split()) print(Z - min(1, Z // Y) - min(1, Z // X))