#include <bits/stdc++.h>
const int N = 100500;
const int INF = 1000000000;
using namespace std;
int n, m, z, ans;
int main() {
  cin >> n >> m >> z;
  for (int i = 1; i <= z; i++) {
    if (i % n == 0 && i % m == 0) ans++;
  }
  cout << ans;
  return 0;
}
