#include <bits/stdc++.h>
using namespace std;
long long b1, q, l;
int m, solution;
unordered_map<long long, bool> H;
int main() {
  cin >> b1 >> q >> l >> m;
  for (int i = 1; i <= m; i++) {
    int x;
    cin >> x;
    H[x] = true;
  }
  solution = 0;
  if (b1 == 0) {
    if (H[b1] == false) {
      cout << "inf";
    } else {
      cout << '0';
    }
    return 0;
  }
  if (q == 0) {
    if (abs(b1) <= l) {
      if (H[0] == false) {
        cout << "inf";
      } else {
        if (H[b1] == false) {
          cout << 1;
        } else {
          cout << 0;
        }
      }
    } else {
      cout << '0';
    }
    return 0;
  }
  if (q == 1) {
    if (abs(b1) <= l) {
      if (H[b1] == false) {
        cout << "inf";
      } else {
        cout << 0;
      }
    } else {
      cout << 0;
    }
    return 0;
  }
  if (q == -1) {
    if (abs(b1) <= l) {
      if (H[b1] == false || H[-b1] == false) {
        cout << "inf";
      } else {
        cout << 0;
      }
    } else {
      cout << 0;
    }
    return 0;
  }
  while (abs(b1) <= l) {
    if (H[b1] == false) {
      solution++;
    }
    b1 *= q;
  }
  cout << solution;
  return 0;
}
