#include <bits/stdc++.h>
using namespace std;
int main() {
  long long b, q, l, m;
  std::cin >> b >> q >> l >> m;
  set<long long> bad;
  long long a;
  for (long long i = 0; i < m; ++i) {
    std::cin >> a;
    bad.insert(a);
  }
  if (abs(b) > l) {
    puts("0");
    return 0;
  }
  vector<long long> v;
  for (int i = 0; abs(b) <= l and abs(b) <= 1000000000 and i < 64;
       b *= q, ++i) {
    if (bad.find(b) == bad.end()) {
      v.push_back(b);
    }
  }
  if (v.size() == 0) {
    std::cout << 0 << '\n';
  } else if (abs(v[v.size() - 1]) == abs(v[v.size() - 2])) {
    puts("inf");
  } else
    std::cout << v.size() << '\n';
  return 0;
}
