#include <bits/stdc++.h>
using namespace std;
set<long long> a;
set<long long> b;
int main() {
  long long b1;
  int q, l, m;
  scanf("%lld%d%d%d", &b1, &q, &l, &m);
  while (m--) {
    int k;
    scanf("%d", &k);
    a.insert(k);
  }
  int num = 0;
  bool u = false;
  while (abs(b1) <= l) {
    if (b.find(b1) != b.end()) {
      u = true;
      break;
    }
    b.insert(b1);
    if (a.find(b1) == a.end()) num++;
    b1 *= q;
  }
  if (u) {
    if (b1 == 0) {
      if (a.find(0) != a.end())
        printf("%d", num);
      else
        printf("inf");
    } else if (q == 1) {
      if (a.find(b1) != a.end())
        printf("0");
      else
        printf("inf");
    } else if (q == 0) {
      if (a.find(0) == a.end())
        printf("inf");
      else
        printf("%d", num);
    } else if (q == -1) {
      if (a.find(b1) != a.end() && a.find(-b1) != a.end())
        printf("0");
      else
        printf("inf");
    }
  } else
    printf("%d", num);
  return 0;
}
