#include <bits/stdc++.h>
using namespace std;
bool find_val_util(long long int a[], int begin, int end, long long int val) {
  if (begin > end) return false;
  int mid = (begin + end) / 2;
  if (a[mid] == val) return true;
  if (a[mid] > val) {
    return find_val_util(a, begin, mid - 1, val);
  } else {
    return find_val_util(a, mid + 1, end, val);
  }
}
bool find_val(long long int a[], long long int m, long long int b) {
  return find_val_util(a, 0, m - 1, b);
}
bool comp(long long int a, long long int b) { return (a < b); }
int main() {
  long long int b, q, l, m;
  long long int a[100005];
  cin >> b >> q >> l >> m;
  int ans = 0;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  sort(a, a + m, comp);
  if (abs(b) > l) {
    cout << "0" << endl;
  } else if (b == 0) {
    if (!find_val(a, m, 0)) {
      cout << "inf" << endl;
    } else {
      cout << "0" << endl;
    }
  } else if (q == 0) {
    if (!find_val(a, m, b) && abs(b) <= l) ans += 1;
    if (!find_val(a, m, 0)) {
      cout << "inf" << endl;
    } else {
      cout << ans << endl;
    }
  } else if (q == 1) {
    if (!find_val(a, m, b) && abs(b) <= l) {
      cout << "inf" << endl;
    } else {
      cout << "0" << endl;
    }
  } else if (q == -1) {
    if (!find_val(a, m, b) && abs(b) <= l) {
      cout << "inf" << endl;
    } else if (!find_val(a, m, -b) && abs(b) <= l) {
      cout << "inf" << endl;
    } else {
      cout << "0" << endl;
    }
  } else {
    while (abs(b) <= l) {
      if (!find_val(a, m, b)) {
        ans += 1;
      }
      b = b * q;
    }
    cout << ans << endl;
  }
  return 0;
}
