#include <bits/stdc++.h>
using namespace std;
int main() {
  long long b, q, l, m;
  set<long long> myset;
  cin >> b >> q >> l >> m;
  long long i = 0;
  for (; i < m; i++) {
    long long z;
    cin >> z;
    myset.insert(z);
  }
  if (b == 0) {
    if (myset.find(0) == myset.end() && abs(b) <= l) {
      cout << "inf";
    } else {
      cout << 0;
    }
  } else if (q == 0) {
    if (myset.find(b) == myset.end() && abs(b) <= l) {
      if (myset.find(0) == myset.end()) {
        cout << "inf";
      } else if (abs(b) <= l) {
        cout << 1;
      } else {
        cout << 0;
      }
    } else {
      if (myset.find(0) == myset.end() && abs(b) <= l) {
        cout << "inf";
      } else {
        cout << 0;
      }
    }
  } else if (q == 1) {
    if (myset.find(b) == myset.end() && abs(b) <= l) {
      cout << "inf";
    } else {
      cout << 0;
    }
  } else if (q == -1) {
    if ((myset.find(b) == myset.end() || myset.find(-1 * b) == myset.end()) &&
        abs(b) <= l) {
      cout << "inf";
    } else {
      cout << 0;
    }
  } else {
    int count = 0;
    while (abs(b) <= l) {
      if (myset.find(b) == myset.end()) count++;
      b *= q;
    }
    cout << count;
  }
  return 0;
}
