#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long b1, q, l, m;
  cin >> b1 >> q >> l >> m;
  string s = "inf";
  unordered_map<long long, bool> mm;
  for (long long i = 0; i < m; i++) {
    long long te;
    cin >> te;
    mm[te] = 1;
  }
  if (abs(l) < abs(b1)) {
    cout << 0;
  } else if (q == 1) {
    if (mm[b1] == 1)
      cout << 0;
    else
      cout << s;
  } else if (q == 0) {
    if (mm[q] == 0)
      cout << s;
    else {
      if (mm[b1] == 1)
        cout << 0;
      else
        cout << 1;
    }
  } else if (q == -1) {
    if (mm[b1] == 1 && mm[-b1] == 1)
      cout << 0;
    else
      cout << s;
  } else if (b1 == 0) {
    if (mm[0] == 1)
      cout << 0;
    else
      cout << s;
  } else {
    long long ans = 0;
    while (abs(b1) <= abs(l)) {
      if (mm[b1] == 0) ans++;
      b1 = b1 * q;
    }
    cout << ans;
  }
}
