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