#include <bits/stdc++.h>
using namespace std;
long long n, m, l, q;
long long x;
set<long long> s;
long long ans;
int main() {
  cin >> n >> q >> l >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x;
    if (!s.count(x)) s.insert(x);
  }
  if (n == 0) {
    if (s.count(0))
      cout << 0;
    else
      cout << "inf";
    return 0;
  }
  if (abs(n) > l) {
    cout << 0;
    return 0;
  }
  if (q == 1) {
    if (s.count(n)) {
      cout << 0 << endl;
      return 0;
    }
    cout << "inf" << endl;
    return 0;
  }
  if (q == -1) {
    if (s.count(n) && s.count(-n)) {
      cout << 0 << endl;
      return 0;
    }
    cout << "inf" << endl;
    return 0;
  }
  if (q == 0) {
    if (!s.count(0)) {
      cout << "inf";
      return 0;
    }
    if (!s.count(n)) {
      cout << 1;
      return 0;
    }
    cout << 0;
    return 0;
  }
  x = n;
  while (abs(x) <= l) {
    if (!s.count(x)) ans++;
    x *= q;
    continue;
  }
  cout << ans;
}
