#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, nehaya;
  cin >> a >> b >> nehaya;
  int ans = 0;
  for (int i = a; i <= nehaya; i += a)
    for (int j = b; j <= nehaya; j += b)
      if (i == j) ans++;
  cout << ans << "\n";
}
