#include <bits/stdc++.h>
using namespace std;
int main() {
  long long b, l, q, m;
  map<int, int> mp;
  cin >> b >> q >> l >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (b == 0) {
    if (mp[0])
      cout << 0 << endl;
    else
      cout << "inf" << endl;
    return 0;
  }
  if (abs(b) > l) {
    cout << 0 << endl;
    return 0;
  }
  if (q == 0) {
    if (mp[0]) {
      if (mp[b])
        cout << 0 << endl;
      else
        cout << 1 << endl;
    } else {
      cout << "inf" << endl;
    }
    return 0;
  }
  if (q == 1) {
    if (mp[b])
      cout << 0 << endl;
    else
      cout << "inf" << endl;
    return 0;
  }
  if (q == -1) {
    if (mp[b] and mp[-b])
      cout << 0 << endl;
    else
      cout << "inf" << endl;
    return 0;
  }
  int cnt = 0;
  while (abs(b) <= l) {
    if (!mp[b]) cnt++;
    b *= q;
  }
  cout << cnt << endl;
  return 0;
}
