#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000000;
map<long long, int> hs;
long long a[30];
long long n, b, b1, q, m, l;
int main() {
  hs.clear();
  int ok = 0, pp = 0, cnt = 1;
  scanf("%I64d%I64d%I64d%I64d", &b1, &q, &l, &n);
  if ((b1 < 0 ? -b1 : b1) > l) {
    printf("0");
    return 0;
  }
  int tot = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%I64d", &b);
    hs[b] = 1;
  }
  m = b1;
  if (hs[m]) hs[m] = 0, tot++, pp = 1;
  if (b1 == 0 || q == 1 || q == 0 || q == -1) ok = 1;
  while ((m * q < 0 ? -m * q : m * q) <= l) {
    m *= q;
    if (hs[m]) tot++, hs[m] = 0;
    ++cnt;
    if (cnt > 100) break;
  }
  if (ok) {
    if (b1 == 0 && tot >= 1)
      printf("0");
    else if (b1 == 0 && tot == 0)
      printf("inf");
    else if (q == 1 && tot >= 1)
      printf("0");
    else if (q == 1 && tot == 0)
      printf("inf");
    else if (q == -1 && tot >= 2)
      printf("0");
    else if (q == -1 && tot < 2)
      printf("inf");
    else if (q == 0 && tot >= 2)
      printf("0");
    else if (q == 0 && pp == 0 && tot)
      printf("1");
    else if (q == 0 && tot < 2)
      printf("inf");
  } else
    printf("%d", cnt - tot);
}
