#include <bits/stdc++.h>
using namespace std;
long long n, m, k, l, i, j, a, b, res, q;
map<int, int> d;
int main() {
  cin >> b >> q >> l >> m;
  if (abs(b) > l) {
    cout << 0;
    return 0;
  }
  for (i = 0; i < m; i++) {
    scanf("%d", &a);
    d[a] = 1;
  }
  if (q == 1 || q == 0) {
    if (d[b * q] == 0)
      cout << "inf";
    else
      cout << 2 - d[b] - d[b * q];
    return 0;
  }
  if (q == -1) {
    if (d[b] == 0 || d[-b] == 0)
      cout << "inf";
    else
      cout << 0;
    return 0;
  }
  if (b == 0) {
    if (d[0] == 0)
      cout << "inf";
    else
      cout << 0;
    return 0;
  }
  while (abs(b) <= l) {
    if (d[b] == 0) res++;
    b *= q;
  }
  cout << res;
}
