#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int cnt = 0;
  vector<int> vt(c + 1);
  int i = 1;
  while ((a * i) <= c) {
    vt[a * i]++;
    i++;
  }
  int j = 1;
  while ((b * j) <= c) {
    if (vt[b * j] >= 1) {
      cnt++;
      j++;
    } else
      j++;
  }
  cout << cnt << endl;
}
