#include <bits/stdc++.h>
using namespace std;
map<long long, int> mm;
int main() {
  int b1, q, l, m;
  scanf("%d %d %d %d", &b1, &q, &l, &m);
  for (int i = 0; i < m; i++) {
    int foo;
    scanf("%d", &foo);
    mm[foo] = 1;
  }
  long long ans = 0;
  if (abs(b1) > l) {
    ans = 0;
  } else if (b1 == 0) {
    if (mm[b1])
      ans = 0;
    else
      ans = INT_MAX;
  } else if (q == 1 || q == -1) {
    if (mm[b1] && mm[b1 * q])
      ans = 0;
    else
      ans = INT_MAX;
  } else if (q == 0) {
    if ((!mm[b1]) && mm[q])
      ans = 1;
    else if (mm[b1] && mm[q])
      ans = 0;
    else
      ans = INT_MAX;
  } else {
    long long use = b1;
    while (abs(use) <= l) {
      if (!mm[use]) ans++;
      use *= q;
    }
  }
  if (ans == INT_MAX)
    puts("inf");
  else
    printf("%I64d\n", ans);
  return 0;
}
