#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, z;
  cin >> n >> m >> z;
  int i = 1;
  int count = 0;
  while (n * i <= z) {
    if ((n * i) % m == 0) count++;
    i++;
  }
  cout << count << endl;
  return 0;
}
