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