#include <bits/stdc++.h>
using namespace std;
void russia() {
  int n, m, z, i, j, cnt = 0;
  cin >> n >> m >> z;
  for (i = m; i <= z; i += m) {
    for (j = n; j <= i; j += n) {
      if (i == j) {
        cnt++;
      }
    }
  }
  cout << cnt << endl;
}
int main() { russia(); }
