#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long b, q, l, m;
  cin >> b >> q >> l >> m;
  vector<long> bad;
  long long i, val, ans = 0, isz = 0, iso = 0, isb = 0, isbm = 0;
  for (i = 0; i < m; i++) {
    cin >> val;
    if (val == 0) isz = 1;
    if (val == 1) iso = 1;
    if (val == b) isb = 1;
    if (val == (-b)) isbm = 1;
    bad.push_back(val);
  }
  if (abs(b) > l)
    cout << "0" << endl;
  else if ((q == 0) || (b == 0)) {
    if (q == 0) {
      if (isz == 0)
        cout << "inf" << endl;
      else if (isb == 1)
        cout << "0" << endl;
      else
        cout << "1" << endl;
    } else if (b == 0) {
      if (isz == 1) {
        cout << "0" << endl;
      } else
        cout << "inf" << endl;
    }
  } else if (q == 1) {
    if (isb == 1) {
      cout << "0" << endl;
    } else
      cout << "inf" << endl;
  } else if (q == -1) {
    if (isb == 1 && isbm == 1)
      cout << "0" << endl;
    else
      cout << "inf" << endl;
  } else {
    ans = 0;
    for (i = b; abs(i) <= l; i *= q) {
      if (std::find(bad.begin(), bad.end(), i) != bad.end()) {
        continue;
      } else
        ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
