#include <bits/stdc++.h>
const double EPS = 0.0000000001;
const long long mod1 = 998244353;
const long long mod2 = 1000000007;
const long long mod3 = 1000000009;
const long long mod4 = 228228227;
const long long inf = 100000000000000;
using namespace std;
signed main() {
  long long b, q, l, m, x;
  cin >> b >> q >> l >> m;
  map<long long, bool> mp;
  for (long long i = 0; i < m; i++) {
    cin >> x;
    mp[x] = 1;
  }
  if (abs(b) > l) {
    cout << 0;
    return 0;
  }
  if (q == 0 || b == 0) {
    if (!mp[0])
      cout << "inf";
    else if (mp[b])
      cout << 0;
    else
      cout << 1;
    return 0;
  }
  if (q == 1) {
    if (mp[b])
      cout << 0;
    else
      cout << "inf";
    return 0;
  }
  if (q == -1) {
    if (mp[b] && mp[-b])
      cout << 0;
    else
      cout << "inf";
    return 0;
  }
  vector<long long> v;
  while (abs(b) <= l) {
    v.push_back(b);
    b *= q;
  }
  long long ans = v.size();
  for (auto it : v)
    if (mp[it]) ans--;
  cout << ans;
}
