#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N = 1e5 + 10;
const ll inf = 1e18 + 100;
const ll MOD = 1e9 + 7;
ll b1, q, l, m;
map<ll, ll> M;
int main() {
  cin >> b1 >> q >> l >> m;
  for (int i = 1; i <= m; i++) {
    ll x;
    cin >> x;
    M[x]++;
  }
  if (llabs(b1) > l) {
    printf("0\n");
    return 0;
  }
  if (b1 == 0) {
    if (M[0] == 0)
      printf("inf\n");
    else
      printf("0\n");
  } else if (q == 0) {
    if (M[0] == 0)
      printf("inf\n");
    else {
      if (M[b1] == 0)
        printf("1\n");
      else
        printf("0\n");
    }
  } else if (q == 1) {
    if (M[b1] == 0)
      printf("inf\n");
    else
      printf("0\n");
  } else if (q == -1) {
    if (M[b1] != 0 && M[-b1] != 0)
      printf("0\n");
    else
      printf("inf\n");
  } else {
    ll cnt = 0;
    ll x = b1;
    while (1) {
      if (llabs(x) > l) break;
      if (M[x]) {
        x *= q;
        continue;
      }
      cnt++;
      x *= q;
    }
    printf("%lld\n", cnt);
  }
  return 0;
}
