#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = 1 << 29;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long b, q, l, m, cnt;
  long long a, i;
  map<long long, long long> mp;
  cin >> b >> q >> l >> m;
  for (int i = 0; i < (m); i++) {
    cin >> a;
    mp[a] = 1;
  }
  if (b == 0 && mp[0] == 1) {
    cout << 0;
    return 0;
  } else if (b == 0) {
    cout << "inf";
    return 0;
  }
  if (q == 0 && abs(b) <= l && !mp[0]) {
    cout << "inf";
    return 0;
  } else if (q == 0 && abs(b) <= l && mp[0] && !mp[b]) {
    cout << 1;
    return 0;
  } else if (q == 0) {
    cout << 0;
    return 0;
  }
  if (q == 1 && abs(b) <= l && !mp[b]) {
    cout << "inf";
    return 0;
  } else if (q == 1) {
    cout << 0;
    return 0;
  }
  if (q == -1 && abs(b) <= l && (!mp[b] || !mp[-b])) {
    cout << "inf";
    return 0;
  } else if (q == -1) {
    cout << 0;
    return 0;
  }
  if (abs(b) <= l) {
    if (mp[b])
      cnt = 0;
    else
      cnt = 1;
  } else {
    cout << 0;
    return 0;
  }
  while (1) {
    b *= q;
    if (abs(b) > l) break;
    if (!mp[b]) cnt++;
  }
  cout << cnt;
  return 0;
}
