#include <bits/stdc++.h>
using namespace std;
int a, b, n, dem = 0, i, j, k;
bool A[100000], B[100000];
int main() {
  cin >> a >> b >> n;
  for (i = 1; i <= (n / a); i++) {
    A[i * a] = true;
  }
  for (j = 1; j <= (n / b); j++) {
    B[j * b] = true;
  }
  for (k = 1; k <= n; k++) {
    if (A[k] == true && B[k] == true) dem++;
  }
  cout << dem;
  return 0;
}
