#include <bits/stdc++.h>
using namespace std;
set<long long int> cant;
int main() {
  long long int b, q, l, m, x;
  cin >> b >> q >> l >> m;
  for (int i = 0; i < m; i++) {
    cin >> x;
    cant.insert(x);
  }
  int c = 0;
  long long int cur = b;
  vector<long long int> ans;
  set<long long int> s;
  while (abs(cur) <= l) {
    if (s.count(cur) || c > 10000) {
      if (cant.count(cur))
        cout << ans.size() << '\n';
      else
        cout << "inf" << '\n';
      return 0;
    }
    if (cant.count(cur)) {
      cur = cur * q;
      c++;
      continue;
    }
    ans.push_back(cur);
    s.insert(cur);
    cur = cur * q;
    c++;
  }
  cout << ans.size() << '\n';
}
