#include <bits/stdc++.h>
using namespace std;
map<long long int, int> coun;
set<long long int> g;
int main() {
  long long int b, d, l, m;
  int i;
  long long int u;
  int terms = 0;
  cin >> b >> d >> l >> m;
  for (i = 0; i < m; i++) {
    cin >> u;
    coun[u] = 1;
  }
  if (b == 0) {
    if (coun[0] == 1)
      cout << "0";
    else
      cout << "inf";
  } else if (d == 0) {
    if (coun[0] == 1) {
      if (coun[b] == 1)
        cout << "0";
      else if (abs(b) <= l)
        cout << "1";
      else
        cout << "0";
    } else {
      if (abs(b) > l)
        cout << "0";
      else
        cout << "inf";
    }
  } else if (d == 1) {
    if (coun[b] == 0 && abs(b) <= l)
      cout << "inf";
    else
      cout << "0";
  } else if (d == -1) {
    if (coun[b] == 1 && coun[-1 * b * 1LL] == 1)
      cout << "0";
    else if (abs(b) <= l)
      cout << "inf";
    else
      cout << "0";
  } else {
    u = b;
    long long int k;
    for (i = 0; i <= 30; i++) {
      k = b * pow(d, i);
      if (coun[k] == 0 && abs(k) <= l) terms++;
      if (abs(k) > l) break;
    }
    cout << terms;
  }
}
