#include <bits/stdc++.h>
using namespace std;
map<int, int> a;
map<int, int> f;
long long myAbs(long long x) { return x < 0 ? -x : x; }
int main() {
  long long b;
  int q, l, m;
  scanf("%I64d", &b);
  scanf("%d%d%d", &q, &l, &m);
  for (int i = 1; i <= m; ++i) {
    int x;
    scanf("%d", &x);
    a[x] = 1;
  }
  if (myAbs(b) > l) {
    printf("0\n");
    return 0;
  }
  if ((a[0] == 0 && (b == 0 || q == 0)) || (q == 1 && a[b] == 0) ||
      (q == -1 && (a[b] == 0 || a[-b] == 0))) {
    printf("inf\n");
    return 0;
  }
  int ans = 0;
  while (myAbs(b) <= l && f[b] == 0) {
    f[b] = 1;
    if (a[b] != 1) ans++;
    b = b * q;
  }
  printf("%d\n", ans);
  return 0;
}
