#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int b, q, l, m;
  cin >> b >> q >> l >> m;
  vector<long long int> v;
  for (long long int i = 0; i < m; i++) {
    long long int tt;
    cin >> tt;
    if (tt <= l) {
      v.push_back(tt);
    }
  }
  sort(v.begin(), v.end());
  if (b == 0) {
    bool ff = binary_search(v.begin(), v.end(), 0);
    if (ff == false) {
      cout << "inf" << endl;
      return 0;
    } else {
      cout << 0 << endl;
      return 0;
    }
  }
  if (q == 1) {
    if (abs(b) <= l) {
      bool ff = binary_search(v.begin(), v.end(), b);
      if (ff == false) {
        cout << "inf" << endl;
        return 0;
      } else {
        cout << 0 << endl;
        return 0;
      }
    } else {
      cout << 0 << endl;
      return 0;
    }
  }
  if (q == 0) {
    if (abs(b) <= l) {
      bool ff = binary_search(v.begin(), v.end(), 0);
      if (ff == false) {
        cout << "inf" << endl;
        return 0;
      } else {
        bool fyy = binary_search(v.begin(), v.end(), b);
        if (fyy == false) {
          cout << 1 << endl;
          return 0;
        } else {
          cout << 0 << endl;
          return 0;
        }
      }
    } else {
      cout << 0 << endl;
      return 0;
    }
  }
  if (q == -1) {
    long long int p = b;
    if (abs(p) <= l) {
      bool fyy = binary_search(v.begin(), v.end(), b);
      bool fyt = binary_search(v.begin(), v.end(), (-1 * b));
      if (fyy == false || fyt == false) {
        cout << "inf" << endl;
        return 0;
      }
      if (fyy == true && fyt == true) {
        cout << 0 << endl;
        return 0;
      }
    } else {
      cout << 0 << endl;
      return 0;
    }
  }
  long long int co = 0;
  long long int p = b;
  if (abs(p) <= l) {
    bool ft = binary_search(v.begin(), v.end(), p);
    if (ft == false) {
      co++;
    }
  } else {
    cout << 0 << endl;
    return 0;
  }
  while (abs(p) <= l) {
    p = p * q;
    if (abs(p) <= l) {
      bool ff = binary_search(v.begin(), v.end(), p);
      if (ff == false) {
        co++;
      }
    }
  }
  cout << co << endl;
  return 0;
}
