#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, z;
  while (cin >> n >> m >> z) {
    int x, y, sum = 0;
    for (x = 0; x <= z; x += n)
      for (y = 0; y <= z; y += m)
        if (x == y) sum++;
    cout << sum - 1 << endl;
  }
  return 0;
}
