#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  return (a / gcd(a, b)) * b;
}
inline double dist(double x1, double y1, double x2, double y2) {
  return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
template <class T>
inline void deb(T a) {
  cout << a << '\n';
}
template <class T1, class T2>
inline void deb(T1 a, T2 b) {
  cout << a << ' ' << b << '\n';
}
template <class T1, class T2, class T3>
inline void deb(T1 a, T2 b, T3 c) {
  cout << a << ' ' << b << ' ' << c << '\n';
}
template <class T>
T power(T a, T b) {
  if (b == 0)
    return 1;
  else if (b % 2 == 1)
    return a * power(a, b - 1);
  else {
    T k = power(a, b / 2);
    return k * k;
  }
}
int main() {
  int t, i, j, tc = 0;
  int a, b, n;
  while (scanf("%d %d %d", &a, &b, &n) == 3) {
    int c = 0;
    int i = 1, xx = b;
    while (xx <= n) {
      if (xx % a == 0) c++;
      i++;
      xx = b * i;
    }
    deb(c);
  }
  return 0;
}
