#include <bits/stdc++.h>
using namespace std;
inline long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const long long maxn = 1e6 + 10;
const long long mod = 1e9 + 7;
const long long infll = 2e18 + 10;
const long long inf = 1e9 + 10;
long long arr[maxn * 2], t;
map<long long, bool> mark;
int32_t main() {
  long long b1 = in(), q = in(), l = in(), m = in();
  for (long long i = 0; i < m; i++) {
    mark[in()] = true;
  }
  long long now = b1;
  long long cnt = 0;
  while (cnt <= 2000000 && abs(now) <= l) {
    if (!mark[now]) {
      arr[t++] = now;
    }
    cnt++;
    now = 1LL * now * q;
  }
  if (t >= 1000000) return cout << "inf\n", 0;
  cout << t << endl;
}
