#include <bits/stdc++.h>
using namespace std;
const int INF = ~(1 << 31);
const double pi = acos(-1);
int main() {
  cin.sync_with_stdio(false);
  long long b1, q, l, m;
  cin >> b1 >> q >> l >> m;
  unordered_map<long long, long long> bad;
  for (int i = (0); i < (m); i++) {
    long long h;
    cin >> h;
    bad[h] = 1;
  }
  vector<int> k;
  unordered_map<long long, long long> times;
  int cnt = 0;
  while (true) {
    long long ne = b1 * q;
    if (cnt == 0) ne = b1;
    if (abs(ne) > l) break;
    k.push_back(ne);
    times[ne]++;
    cnt++;
    if (cnt > 10000) break;
    b1 = ne;
  }
  vector<int> nek;
  for (int i = (0); i < (k.size()); i++)
    if (bad.find(k[i]) == bad.end()) nek.push_back(k[i]);
  if (nek.size() == 0) {
    cout << "0" << endl;
    return 0;
  }
  set<int> hh;
  for (int i = (0); i < (nek.size()); i++) {
    if (times[nek[i]] > 1) {
      cout << "inf" << endl;
      return 0;
    }
    hh.insert(nek[i]);
  }
  cout << hh.size() << endl;
  return 0;
}
