#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100004;
long long b, q, l, m;
long long a[MAXN];
int chk(int val) {
  int s = 0, e = m - 1, mid;
  while (s <= e) {
    mid = (s + e) / 2;
    if (a[mid] == val)
      return 1;
    else if (a[mid] < val)
      s = mid + 1;
    else
      e = mid - 1;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(NULL);
  cin.tie(0);
  cin >> b >> q >> l >> m;
  for (int i = 0; i < m; i++) cin >> a[i];
  sort(a, a + m);
  if (b == 0) {
    if (chk(0))
      cout << "0\n";
    else
      cout << "inf\n";
    return 0;
  }
  if (abs(b) > l) {
    cout << "0\n";
    return 0;
  }
  if (q == 0) {
    if (abs(b) > l && chk(0)) {
      cout << "0\n";
      return 0;
    }
    if (abs(b) > l && !chk(0)) {
      cout << "inf\n";
      return 0;
    }
    if (chk(b)) {
      if (chk(0)) {
        cout << "0\n";
        return 0;
      } else
        cout << "inf\n";
      return 0;
    } else {
      if (chk(0)) {
        cout << "1\n";
        return 0;
      } else
        cout << "inf\n";
      return 0;
    }
  }
  if (q == 1) {
    if (chk(b))
      cout << "0\n";
    else if (abs(b) <= l)
      cout << "inf\n";
    else
      cout << "0\n";
    return 0;
  }
  if (q == -1) {
    if (abs(b) <= l) {
      int ans = 0;
      if (!chk(b)) ans++;
      if (!chk(-b)) ans++;
      if (ans == 0)
        cout << "0\n";
      else
        cout << "inf\n";
      return 0;
    } else
      cout << "0\n";
    return 0;
  }
  long long ans = 0;
  if (!chk(b) && abs(b) <= l) ans++;
  while (abs(b * q) <= l) {
    b = b * q;
    if (!chk(b)) ans++;
  }
  cout << ans << "\n";
}
