#include <bits/stdc++.h>
using namespace std;
long long b, q, l, m, x, ans;
map<long long, int> mp;
int main() {
  scanf("%I64d %I64d %I64d %I64d", &b, &q, &l, &m);
  while (m--) {
    scanf("%I64d", &x);
    mp[x]++;
  }
  long long z = b;
  int i = 0;
  while (abs(z) <= l && i < 64 && z <= 1000000000) {
    if (!mp[z]) ans++;
    z *= q;
    i++;
  }
  if (ans > 30)
    cout << "inf" << endl;
  else
    cout << ans << endl;
  return 0;
}
