#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long b, q, l, m;
  set<long long> bad;
  cin >> b >> q >> l >> m;
  for (int i = 0; i < m; i++) {
    long long tmp;
    cin >> tmp;
    bad.insert(tmp);
  }
  if (abs(b) > l) {
    cout << 0 << endl;
  } else if (b == 0) {
    if (bad.count(0))
      cout << 0 << endl;
    else
      cout << "inf\n";
  } else if (q == 1) {
    if (bad.count(b))
      cout << 0 << endl;
    else
      cout << "inf\n";
  } else if (q == -1) {
    if (bad.count(b) && bad.count(-b))
      cout << 0 << endl;
    else
      cout << "inf\n";
  } else if (q == 0) {
    if (!bad.count(0))
      cout << "inf" << endl;
    else if (bad.count(b))
      cout << 0 << endl;
    else
      cout << 1 << endl;
  } else {
    long long p = b;
    long long num = 0;
    while (abs(p) <= l) {
      if (!bad.count(p)) num++;
      p = p * q;
    }
    cout << num << endl;
  }
  return 0;
}
