#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long b1, q, l, m;
  cin >> b1 >> q >> l >> m;
  int arr[m];
  for (int i = 0; i < m; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + m);
  if (abs(b1) > l) cout << 0, exit(0);
  if (b1 == 0) {
    if (binary_search(arr, arr + m, 0)) cout << 0, exit(0);
    cout << "inf", exit(0);
  }
  if (q == 1) {
    if (binary_search(arr, arr + m, b1)) cout << 0, exit(0);
    cout << "inf", exit(0);
  }
  if (q == -1) {
    if (binary_search(arr, arr + m, b1) && binary_search(arr, arr + m, -b1))
      cout << 0, exit(0);
    cout << "inf", exit(0);
  }
  if (q == 0) {
    if (!binary_search(arr, arr + m, 0)) cout << "inf", exit(0);
    if (binary_search(arr, arr + m, b1)) cout << 0, exit(0);
    cout << 1, exit(0);
  }
  int ans = 0;
  long long b = b1;
  while (abs(b) <= l) {
    ans++;
    if (binary_search(arr, arr + m, b)) ans--;
    b *= q;
  }
  cout << ans << endl;
}
