#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, l, m, cnt;
  long long b;
  map<int, bool> bads;
  map<int, bool> visit;
  scanf("%lld%d%d%d", &b, &q, &l, &m);
  for (int i = 0; i < m; i++) {
    int in;
    scanf("%d", &in);
    bads[in] = true;
  }
  cnt = 0;
  if (abs(b) > l) {
    printf("0");
    return 0;
  }
  while (abs(b) <= l && !visit[b]) {
    visit[b] = true;
    if (!bads[b]) cnt++;
    b *= q;
  }
  if (visit[b] && !bads[b])
    printf("inf");
  else if (q == -1 && (!bads[b * q] || !bads[b * q * q]))
    printf("inf");
  else
    printf("%d", cnt);
}
