#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, count = 0;
  cin >> n >> m >> k;
  int mi = m;
  int a[100001];
  int i = 0, j = 1, t;
  while (m * j <= k) {
    a[i] = mi * j;
    i++;
    j++;
  }
  for (t = 0; t < i; t++) {
    if (a[t] % n == 0) count++;
  }
  cout << count;
}
