#include <bits/stdc++.h>
using namespace std;
long long b1, ans = 0, q, m, b[100009], l;
bool isbad(long long x) {
  long long d = 0, u = m - 1;
  while (d <= u) {
    long long mid = (u + d) / 2;
    if (b[mid] == x) {
      return true;
    } else if (b[mid] < x) {
      d = mid + 1;
    } else
      u = mid - 1;
  }
  return false;
}
int main() {
  cin >> b1 >> q >> l >> m;
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  if (abs(b1) > l) {
    cout << "0\n";
    return 0;
  }
  sort(b, b + m);
  if (b1 == 0) {
    if (isbad(b1)) {
      cout << 0 << endl;
    } else
      cout << "inf\n";
  } else if (q == 0) {
    if (!isbad(b1) && abs(b1) <= l) {
      ans++;
    }
    if (isbad(0)) {
      cout << ans << endl;
    } else
      cout << "inf\n";
  } else if (q == 1) {
    if (isbad(b1)) {
      cout << 0 << endl;
    } else
      cout << "inf\n";
  } else if (q == -1) {
    if (isbad(b1) && isbad(0 - b1)) {
      cout << "0\n";
    } else {
      cout << "inf\n";
    }
  } else {
    while (abs(b1) <= l) {
      if (!isbad(b1)) ans++;
      b1 *= q;
    }
    cout << ans << endl;
  }
  return 0;
}
