#include <bits/stdc++.h>
using namespace std;
set<long long int> s;
int main() {
  ios_base::sync_with_stdio(0);
  long long int cnt = 0, ans = 0, i, b, q, m, l, x;
  cin >> b >> q >> l >> m;
  for (int(i) = (1); (i) <= (m); ++i) {
    cin >> x;
    s.insert(x);
  }
  if (b == 0) {
    if (s.find(0) == s.end()) {
      cout << "inf";
    } else
      cout << 0;
  } else if (q == 0) {
    if (s.find(0) == s.end() && abs(b) <= l)
      cout << "inf";
    else if (s.find(b) == s.end() && abs(b) <= l)
      cout << 1;
    else
      cout << 0;
  } else if (q == 1) {
    if (s.find(b) == s.end() && abs(b) <= l) {
      cout << "inf";
    } else
      cout << 0;
  } else if (q == -1) {
    if ((s.find(b) == s.end() || s.find(-b) == s.end()) && (abs(b) <= l)) {
      cout << "inf";
    } else
      cout << 0;
  } else {
    for (long long int p = b; abs(p) <= l; p *= q) {
      if (s.find(p) == s.end()) ans++;
    }
    cout << ans;
  }
  return 0;
}
