#include <bits/stdc++.h>
using namespace std;
bool arr[10007] = {false};
int main() {
  long long int n, m, z;
  cin >> n >> m >> z;
  long long int i = n;
  while (i <= z) {
    arr[i] = true;
    i = i + n;
    if (i > z) break;
  }
  i = m;
  long long int cnt = 0;
  while (i <= z) {
    if (arr[i] == true) cnt++;
    i = i + m;
    if (i > z) break;
  }
  cout << cnt;
  return 0;
}
