#include <bits/stdc++.h>
using namespace std;
long long a[999999];
map<int, int> aa;
int main() {
  long long b1, q, l, m, ans = 0;
  cin >> b1 >> q >> l >> m;
  if (abs(b1) > l) {
    cout << 0;
    exit(0);
  }
  for (int i = 1; i <= m; ++i) {
    cin >> a[i];
    aa[a[i]]++;
  }
  if (b1 == 0) {
    if (aa[b1]) {
      cout << 0;
      exit(0);
    } else {
      cout << "inf";
      exit(0);
    }
  }
  if (q == 1) {
    if (aa[b1]) {
      cout << 0;
      exit(0);
    } else {
      cout << "inf";
      exit(0);
    }
  }
  if (q == -1) {
    if (aa[b1] && aa[b1 * q]) {
      cout << 0;
      exit(0);
    } else {
      cout << "inf";
      exit(0);
    }
  }
  if (q == 0) {
    if (!aa[0]) {
      cout << "inf";
      exit(0);
    } else if (aa[b1]) {
      cout << 0;
      exit(0);
    } else {
      cout << 1;
      exit(0);
    }
  }
  if (!aa[b1]) {
    ans++;
  }
  while (1) {
    b1 *= q;
    if (abs(b1) > l) {
      cout << ans;
      exit(0);
    }
    if (!aa[b1]) {
      ans++;
    }
  }
  exit(0);
}
