#include <bits/stdc++.h>
using namespace std;
int main() {
  long long b, q, l, m;
  scanf("%lld%lld%lld%lld", &b, &q, &l, &m);
  long long i, a;
  set<long long> st;
  for (i = 1; i <= m; i++) {
    scanf("%lld", &a);
    st.insert(a);
  }
  if (b == 0) {
    if (st.count(0) > 0)
      printf("0\n");
    else
      printf("inf\n");
    return 0;
  }
  if (abs(b) > l) {
    printf("0\n");
    return 0;
  }
  if ((q == 0 || q == 1 || q == -1)) {
    if (q == 0 && (st.count(0) > 0)) {
      if (st.count(b) > 0)
        printf("0\n");
      else
        printf("1\n");
      return 0;
    }
    if (q == 1 && (st.count(b) > 0)) {
      printf("0\n");
      return 0;
    }
    if (q == -1 && (st.count(b) > 0) && (st.count(-b) > 0)) {
      printf("0\n");
      return 0;
    }
    printf("inf\n");
    return 0;
  }
  int il;
  il = 0;
  while (abs(b) <= l) {
    if (st.count(b) == 0) il++;
    b *= q;
  }
  printf("%d\n", il);
  return 0;
}
