#include <bits/stdc++.h>
using namespace std;
void io() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
}
map<long long, bool> mp;
int main(int argc, char* argv[]) {
  io();
  long long b1, q, l, m;
  cin >> b1 >> q >> l >> m;
  long long a;
  for (int i = 1; i <= m; i++) {
    cin >> a;
    mp[a] = 1;
  }
  if (abs(b1) > l) {
    cout << 0 << '\n';
    return 0;
  }
  if (b1 == 0) {
    if (mp[0] == 1) {
      cout << 0 << '\n';
    } else {
      cout << "inf\n";
    }
  } else if (q == 0) {
    if (mp[b1] && mp[0]) {
      cout << 0 << '\n';
    } else if (mp[b1] && !mp[0]) {
      cout << "inf" << '\n';
    } else if (!mp[b1] && mp[0]) {
      cout << "1\n";
    } else {
      cout << "inf\n";
    }
  } else if (q == 1 || q == -1) {
    if (q == 1) {
      if (mp[b1]) {
        cout << 0 << '\n';
      } else {
        cout << "inf\n";
      }
    } else {
      if (!mp[b1] || !mp[-b1]) {
        cout << "inf\n";
      } else {
        cout << 0 << '\n';
      }
    }
  } else {
    long long abv = abs(b1);
    long long abq = abs(q);
    long long v = b1;
    long long ans = 0;
    while (abv <= l) {
      if (mp[v]) {
      } else {
        ans++;
      }
      abv = abv * abq;
      v = v * q;
    }
    cout << ans << '\n';
  }
  return 0;
}
