#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long n, m, z;
  cin >> n >> m >> z;
  long long ans = 0;
  long long mm = m;
  while (m <= z) {
    if (m % n == 0) {
      ++ans;
    }
    m += mm;
  }
  cout << ans;
  return 0;
}
