#include <bits/stdc++.h>
using namespace std;
int m;
map<long long, int> mp;
int main() {
  long long b, q, l, x;
  cin >> b >> q >> l >> m;
  for (int i = 0; i < m; i++) {
    cin >> x;
    mp[x] = 1;
  }
  if (b == 0) {
    if (mp.find(0) == mp.end())
      cout << "inf";
    else
      cout << 0;
  } else if (q == 1) {
    if (abs(b) <= l) {
      if (mp.find(b) == mp.end())
        cout << "inf";
      else
        cout << 0;
    } else
      cout << 0;
  } else if (q == -1) {
    if (abs(b) <= l) {
      if (mp.find(b) == mp.end()) {
        if (mp.find((-b)) == mp.end())
          cout << "inf";
        else
          cout << "inf";
      } else {
        if (mp.find((-b)) == mp.end())
          cout << "inf";
        else
          cout << 0;
      }
    } else
      cout << 0;
  } else if (q == 0) {
    if (abs(b) > l) {
      cout << 0;
      return 0;
    } else {
      if (mp.find(b) == mp.end()) {
        if (mp.find(0) == mp.end()) {
          cout << "inf";
        } else
          cout << 1;
        return 0;
      } else {
        if (mp.find(0) == mp.end()) {
          cout << "inf";
        } else
          cout << 0;
        return 0;
      }
    }
  } else {
    int c = 0;
    long long cur = b;
    while (abs(cur) <= l) {
      if (mp.find(cur) == mp.end()) {
        c++;
        cur = cur * q;
      } else
        cur = cur * q;
    }
    cout << c << endl;
  }
  return 0;
}
