#include <bits/stdc++.h>
using namespace std;
long long b[100010], a[100010];
int main() {
  int p, l, m;
  scanf("%lld%d%d%d", &b[1], &p, &l, &m);
  for (int i = 0; i <= m; i++) a[i] = 0x3f3f3f;
  for (int i = 0; i < m; i++) scanf("%lld", &a[i]);
  sort(a, a + m);
  if (abs(b[1]) > l)
    printf("0\n");
  else if (b[1] == 0 || p == 1) {
    int pos = lower_bound(a, a + m, b[1]) - a;
    if (a[pos] == b[1])
      printf("0\n");
    else
      printf("inf\n");
  } else if (p == 0) {
    int pos1 = lower_bound(a, a + m, 0) - a;
    int pos2 = lower_bound(a, a + m, b[1]) - a;
    if (a[pos1] != 0)
      printf("inf\n");
    else if (a[pos2] == b[1])
      printf("0\n");
    else
      printf("1\n");
  } else if (p == -1) {
    int pos1 = lower_bound(a, a + m, b[1]) - a;
    int pos2 = lower_bound(a, a + m, -b[1]) - a;
    if (a[pos1] == b[1] && a[pos2] == -b[1])
      printf("0\n");
    else
      printf("inf\n");
  } else {
    int cnt = 0;
    for (long long i = b[1]; abs(i) <= l; i = i * p) {
      int pos = lower_bound(a, a + m, i) - a;
      if (a[pos] != i) cnt++;
    }
    printf("%d\n", cnt);
  }
  return 0;
}
