#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n, m, z;
  while (scanf("%d %d %d", &n, &m, &z) != EOF) {
    printf("%d\n", z / (m / gcd(m, n) * n));
  }
  return 0;
}
