#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e8, MAX = 1e5 + 1e4, MOD = 1e9 + 7;
void OUT(long double o, int x) {
  cout << fixed << setprecision(x) << o;
  return;
}
long long a[MAX], b[MAX];
map<long long, bool> t;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long b1, q, l, m;
  cin >> b1 >> q >> l >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    t[a[i]] = 1;
  }
  if (abs(b1) > l) return cout << 0, 0;
  if (b1 != 0 && q == 0) {
    if (!t[b1] && t[0])
      cout << 1;
    else if (!t[0])
      cout << "inf";
    else
      cout << 0;
    return 0;
  }
  if (q == 0 || b1 == 0) {
    if (t[0])
      cout << 0;
    else
      cout << "inf";
    return 0;
  }
  if (q == 1) {
    if (t[b1])
      cout << 0;
    else
      cout << "inf";
    return 0;
  }
  if (q == -1) {
    if (t[b1] && t[-1 * b1])
      cout << 0;
    else
      cout << "inf";
    return 0;
  }
  long long x = 0, y = b1;
  while (abs(y) <= l) {
    if (!t[y]) x++;
    y *= q;
  }
  cout << x;
  return 0;
}
