// https://szkopul.edu.pl/problemset/problem/XhSo6BU-Ee0RtCzqf49mSZZE/site/?key=statement
// XVII OIJ (1 etap)
#include <iostream>
long long nwd(long long int a, long long int b) {
if (b == 0) {
return a;
} else {
return nwd(b, a % b);
}
}
long long nww(long long a, long long b) {
return (a * b) / nwd(a, b);
}
int main() {
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
std::cout.tie(0);
long long a, b, c;
std::cin >> a >> b >> c;
auto res = nww(a, b);
std::cout << c / res;
return 0;
}