#include <bits/stdc++.h>
using namespace std;
long long int a[100005];
map<long long, int> mp;
int main() {
  long long int b1, q, l, m;
  scanf("%lld %lld %lld %lld", &b1, &q, &l, &m);
  for (int i = 0; i < m; i++) {
    scanf("%lld", &a[i]);
    mp[a[i]] = 1;
  }
  if (abs(b1) > l) {
    printf("0\n");
    return 0;
  }
  if (b1 == 0 && q == 0) {
    if (mp[0])
      printf("0\n");
    else
      printf("inf\n");
    return 0;
  }
  if (b1 == 0) {
    if (mp[0])
      printf("0\n");
    else
      printf("inf\n");
    return 0;
  }
  if (q == 0) {
    int cnt = 2;
    if (!mp[0])
      printf("inf\n");
    else {
      if (mp[b1])
        printf("0\n");
      else
        printf("1\n");
    }
    return 0;
  }
  if (q == 1) {
    if (mp[b1])
      printf("0\n");
    else
      printf("inf\n");
    return 0;
  }
  if (q == -1) {
    if (mp[b1] && mp[-b1])
      printf("0\n");
    else
      printf("inf\n");
    return 0;
  }
  if (abs(q) >= 2) {
    vector<long long> series;
    series.push_back(b1);
    long long prev = b1;
    while (1) {
      long long newterm = prev * q;
      if (abs(newterm) > l) break;
      series.push_back(newterm);
      prev = newterm;
    }
    long long int totalterms = series.size();
    for (int i = 0; i < series.size(); i++) {
      if (mp[series[i]]) totalterms--;
    }
    printf("%lld\n", totalterms);
  }
  return 0;
}
