#include <bits/stdc++.h>
using namespace std;
set<long long> S;
long long b, q, l, m;
map<long long, int> H;
int main() {
  cin >> b >> q >> l >> m;
  for (int i = 0; i < m; i++) {
    long long k;
    cin >> k;
    S.insert(k);
  }
  int time = 0;
  int ans = 0;
  long long now = b;
  while (time < 500000) {
    time++;
    if (abs(now) > l) break;
    if (S.find(now) == S.end()) {
      ans++;
    }
    now = now * q;
  }
  if (ans > 30000) {
    cout << "inf" << endl;
  } else {
    cout << ans << endl;
  }
}
