#include <bits/stdc++.h>
const double PI = acos(-1);
const double eps = 1e-9;
using namespace std;
int ans, t, i, j, k, n, m;
int a[1005];
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
char s[1005];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  int l = n * m / gcd(n, m);
  ans = k / l;
  printf("%d\n", ans);
  return 0;
}
