#include <bits/stdc++.h>
using namespace std;
mt19937 gen(880907);
template <typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& p) {
  out << p.first << " " << p.second;
  return out;
}
long long b1, q, l, m;
vector<long long> arr;
set<long long> s;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> b1 >> q >> l >> m;
  arr.clear();
  arr.resize(m);
  for (int i = 0; i < m; i++) cin >> arr[i];
  sort(arr.begin(), arr.end());
  long long cnt = 0, now = b1;
  if (b1 == 0) {
    if (lower_bound(arr.begin(), arr.end(), now) == arr.end() ||
        *lower_bound(arr.begin(), arr.end(), now) != now)
      cout << "inf" << '\n';
    else
      cout << 0 << '\n';
    return 0;
  }
  while (abs(now) <= l) {
    if ((lower_bound(arr.begin(), arr.end(), now) != arr.end() &&
         *lower_bound(arr.begin(), arr.end(), now) == now)) {
      if (now == now * q || s.count(now)) {
        if (q == -1 &&
            ((lower_bound(arr.begin(), arr.end(), now) == arr.end() ||
              *lower_bound(arr.begin(), arr.end(), now) != now) ||
             (lower_bound(arr.begin(), arr.end(), -now) == arr.end() ||
              *lower_bound(arr.begin(), arr.end(), -now) != -now)))
          cout << "inf" << '\n';
        else
          cout << cnt << '\n';
        return 0;
      }
      s.insert(now);
      now *= q;
      continue;
    }
    if (!s.count(now) &&
        (lower_bound(arr.begin(), arr.end(), now) == arr.end() ||
         *lower_bound(arr.begin(), arr.end(), now) != now))
      cnt++;
    if (s.count(now)) {
      if (abs(q) <= 1 &&
          (now != 0 || (lower_bound(arr.begin(), arr.end(), now) == arr.end() ||
                        *lower_bound(arr.begin(), arr.end(), now) != now))) {
        cout << "inf" << '\n';
        return 0;
      }
      break;
    } else
      s.insert(now);
    now *= q;
  }
  cout << cnt << '\n';
  return 0;
}
