#include <bits/stdc++.h>
using namespace std;
int main() {
  long long b, q, l, m, t0(0), tn(0), cnt(0), tb(0);
  cin >> b >> q >> l >> m;
  long long a[m];
  set<long long> s;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    if (a[i] == 0) t0++;
    if (a[i] == b) tn++;
    if (a[i] == (b * (-1))) tb++;
    if (b == 0) continue;
    s.insert(a[i]);
  }
  if (q == 1) {
    if ((tn != 0) or (abs(b) > l))
      cout << 0;
    else
      cout << "inf";
    return (0);
  }
  if (q == -1) {
    if (((tn != 0) and (tb != 0)) or (abs(b) > l))
      cout << 0;
    else
      cout << "inf";
    return (0);
  }
  if (b == 0) {
    if (t0 != 0)
      cout << 0;
    else
      cout << "inf";
    return (0);
  }
  if (q == 0) {
    if (abs(b) > l) return cout << 0, 0;
    if (t0 == 0) return cout << "inf", 0;
    if ((tn == 0) and (abs(b) <= l))
      cout << 1;
    else
      cout << 0;
    return (0);
  }
  if (abs(b) > l) {
    return cout << 0, 0;
  }
  long long ans = 0;
  while (abs(b) <= l) {
    if (s.find(b) != s.end()) ans--;
    ans++;
    b *= q;
  }
  cout << ans;
}
