#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
long long b1, q, l, m;
map<long long, int> mp;
long long a[maxn];
int main() {
  scanf("%lld%lld%lld%lld", &b1, &q, &l, &m);
  for (int i = 1; i <= m; i++) scanf("%lld", &a[i]), mp[a[i]] = 1;
  if (b1 == 0) {
    if (mp[0])
      printf("0\n");
    else
      printf("inf\n");
  } else if (q == 0) {
    if (abs(b1) > l)
      printf("0\n");
    else if (mp[b1] && mp[0])
      printf("0\n");
    else if (!mp[b1] && mp[0])
      printf("1\n");
    else
      printf("inf\n");
  } else if (q == 1) {
    if (abs(b1) > l || mp[b1])
      printf("0\n");
    else
      printf("inf\n");
  } else if (q == -1) {
    if (abs(b1) > l || (mp[b1] && mp[-b1]))
      printf("0\n");
    else
      printf("inf\n");
  } else {
    int ans = 0;
    long long t = b1;
    while (abs(t) <= l) {
      if (mp[t] == 0) ans++;
      t = t * q;
    }
    printf("%d\n", ans);
  }
  return 0;
}
