#include <bits/stdc++.h>
using namespace std;
set<int> s;
int main() {
  int b1, q, l, m;
  cin >> b1 >> q >> l >> m;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    s.insert(a);
  }
  long long sum = 0;
  if (b1 == 0) {
    set<int>::iterator iter;
    if ((iter = s.find(0)) == s.end())
      cout << "inf" << endl;
    else
      cout << 0 << endl;
    return 0;
  }
  if (q == 0) {
    if (abs(b1) <= l) {
      set<int>::iterator iter;
      if ((iter = s.find(0)) == s.end())
        cout << "inf" << endl;
      else if ((iter = s.find(b1)) == s.end())
        cout << 1 << endl;
      else
        cout << 0 << endl;
    } else {
      cout << 0 << endl;
    }
    return 0;
  }
  if ((q == 1)) {
    if (abs(b1) <= l) {
      set<int>::iterator iter;
      if ((iter = s.find(b1)) != s.end())
        cout << 0 << endl;
      else
        cout << "inf" << endl;
    } else
      cout << 0 << endl;
    return 0;
  }
  if ((q == -1)) {
    if (abs(b1) <= l) {
      set<int>::iterator iter;
      if (((iter = s.find(b1)) != s.end()) && ((iter = s.find(-b1)) != s.end()))
        cout << 0 << endl;
      else
        cout << "inf" << endl;
    } else {
      cout << 0 << endl;
    }
    return 0;
  }
  for (long long i = b1; abs(i) <= l; i *= q) {
    set<int>::iterator iter;
    if ((iter = s.find(i)) == s.end()) sum++;
  }
  cout << sum << endl;
  return 0;
}
