#include <bits/stdc++.h>
using namespace std;
int main() {
  long long b1, q, l, m;
  cin >> b1 >> q >> l >> m;
  long long bad = 0;
  set<long long> prev;
  for (long long i = 0; i < m; ++i) {
    long long a;
    cin >> a;
    long long cop = a;
    prev.insert(cop);
  }
  long long ans = 0;
  int i = 0;
  vector<long long> out;
  while (i <= 1000000) {
    i++;
    if (abs(b1) > l) continue;
    if (prev.find(b1) == prev.end()) out.push_back(b1);
    b1 = b1 * q;
  }
  if (out.size() > 100000)
    cout << "inf";
  else
    cout << out.size();
  return 0;
}
