#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, n, s, t, m, z;
  cin >> n >> m >> z;
  a = 1;
  b = 0;
  c = 1;
  s = n;
  t = m;
  while (n <= z && m <= z) {
    n = s * a;
    m = t * c;
    if (n <= z && m <= z) {
      if (n == m) {
        b++;
        c++;
        a++;
      }
      if (n > m)
        c++;
      else if (n < m)
        a++;
    }
  }
  cout << b << endl;
}
