#include <bits/stdc++.h>
using namespace std;
unordered_set<long long> S;
long long b, q, l, m, x;
inline bool ok(long long n) { return abs(n) <= l && !S.count(n); }
void solve() {
  cin >> b >> q >> l >> m;
  for (int i = 0; i < m; ++i) {
    cin >> x;
    S.insert(x);
  }
  if (abs(b) > l) {
    cout << 0;
    return;
  }
  if (b == 0) {
    if (ok(0))
      cout << "inf";
    else
      cout << 0;
    return;
  }
  int ans = 0;
  if (q == 0) {
    if (ok(0))
      ans = -1;
    else
      ans = ok(b);
  } else if (q == 1) {
    ans = ok(b) ? -1 : 0;
  } else if (q == -1) {
    if (ok(b) || ok(-b))
      ans = -1;
    else
      ans = 0;
  } else
    while (abs(b) <= l) {
      ans += !S.count(b);
      b *= q;
    }
  if (ans == -1)
    cout << "inf";
  else
    cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
