#include <bits/stdc++.h>
using namespace std;
set<long long> s;
int main() {
  long long b, q, l, m;
  cin >> b >> q >> l >> m;
  if (abs(b) > l) {
    cout << 0;
    return 0;
  }
  for (int i = 1; i <= m; i++) {
    int a;
    cin >> a;
    s.insert(a);
  }
  int ans = 0;
  if (s.count(b) == 0) ans++;
  if (b == 0)
    if (s.count(0) == 0) {
      cout << "inf";
      return 0;
    } else {
      cout << 0;
      return 0;
    }
  if (q == 1)
    if (s.count(b) == 0) {
      cout << "inf";
      return 0;
    } else {
      cout << 0;
      return 0;
    }
  if (q == -1)
    if (s.count(b) == 0 or s.count(-b) == 0) {
      cout << "inf";
      return 0;
    } else {
      cout << 0;
      return 0;
    }
  if (q == 0)
    if (s.count(0) == 0) {
      cout << "inf";
      return 0;
    } else {
      cout << ans;
      return 0;
    }
  while (true) {
    b *= q;
    if (abs(b) > l) break;
    if (s.count(b) == 0) ans++;
  }
  cout << ans;
  return 0;
}
