#include <bits/stdc++.h>
using namespace std;
int main() {
  long long b, q, l, m;
  cin >> b >> q >> l >> m;
  map<long long, int> map;
  for (int i = 0; i < m; i++) {
    int a;
    scanf("%d", &a);
    map[a] = 1;
  }
  if (b == 0) {
    if (map[0] == 1) {
      cout << 0;
    } else
      cout << "inf";
  } else if (q == 0) {
    if (map[0] == 1) {
      if (map[b] == 1) {
        cout << 0;
      } else if (b <= l && b >= -l)
        cout << 1;
      else
        cout << 0;
    } else {
      if (b <= l && b >= -l)
        cout << "inf";
      else
        cout << 0;
    }
  } else if (q == 1) {
    if (map[b] == 1)
      cout << 0;
    else if (b <= l && b >= -l)
      cout << "inf";
    else
      cout << 0;
  } else if (q == -1) {
    if (map[b] == 1 && map[-b] == 1)
      cout << 0;
    else if (b <= l && b >= -l)
      cout << "inf";
    else
      cout << 0;
  } else {
    int c = 0;
    while (b <= l && b >= -l) {
      if (map[b] != 1) c++;
      b *= q;
    }
    cout << c;
  }
  return 0;
}
