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