#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const long long ll_max = 9223372036854775800;
const long long ll_min = -9223372036854775800;
const int int_max = 2147483640;
const int int_min = -2147483640;
const long long mod = 1000000007;
vector<std::vector<int> > g;
int main() {
  long long answ = 0;
  long long b1, q, l, m;
  cin >> b1 >> q >> l >> m;
  long long tmp;
  set<long long> a;
  for (int i = 0; i < m; ++i) {
    cin >> tmp;
    a.insert(tmp);
  }
  long long b = b1;
  for (int i = 1; i < 300 && abs(b) <= l; ++i, b *= q) {
    if (a.find(b) == a.end()) {
      ++answ;
    }
  }
  if (answ > 100) {
    cout << "inf" << endl;
  } else {
    cout << answ << endl;
  }
  int letsmakepause;
  std::cin >> letsmakepause;
  return 0;
}
