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