#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long a, r, l, m;
  cin >> a >> r >> l >> m;
  set<long long> bad;
  for (int i = 0; i < m; i++) {
    long long t;
    cin >> t;
    bad.insert(t);
  }
  if (abs(a) > l)
    cout << 0;
  else if (r == 1 || a == 0) {
    if (bad.find(a) != bad.end())
      cout << 0;
    else
      cout << "inf";
  } else if (r == -1) {
    if (bad.find(-1 * a) != bad.end() && bad.find(a) != bad.end())
      cout << 0;
    else
      cout << "inf";
  } else if (r == 0) {
    if (bad.find(0) == bad.end())
      cout << "inf";
    else if (bad.find(a) != bad.end())
      cout << 0;
    else
      cout << 1;
  } else {
    long long count = 0;
    while (abs(a) <= l) {
      if (bad.find(a) == bad.end()) count++;
      a = a * r;
    }
    cout << count;
  }
  return 0;
}
