#include <bits/stdc++.h>
using namespace std;
long long b, q, l, a;
int m;
map<long long, int> mp, mp1;
int main() {
  cin >> b >> q >> l >> m;
  for (int i = 0; i < m; i++) {
    cin >> a;
    mp[a] = 1;
  }
  int ans = 0;
  while (abs(b) <= l) {
    mp1[b]++;
    if (mp1[b] == 2 && mp[b] == 0) {
      cout << "inf" << endl;
      return 0;
    }
    if (mp1[b] == 4 && mp[b] == 1) {
      cout << ans << endl;
      return 0;
    }
    if (mp[b] == 0) {
      ans++;
    }
    b = b * q;
  }
  cout << ans << endl;
}
