#include <bits/stdc++.h>
using namespace std;
int main() {
  (ios_base::sync_with_stdio(false), cin.tie(NULL));
  ;
  int n, m, t;
  cin >> n >> m >> t;
  if (n == 1 || n == m)
    cout << t / m << endl;
  else {
    int cnt = 0, sum = n, sum1 = m;
    while (n <= t && m <= t) {
      if (n == m) cnt++;
      if (n >= m)
        m += sum1;
      else
        n += sum;
    }
    cout << cnt << endl;
  }
}
