#include <bits/stdc++.h>
using namespace std;
const long long infll = powl(2, 63) - 1;
void dPrint(vector<long long> &arr) {
  for (long long i = 0; i < (long long)(arr.size()); ++i) cout << arr[i] << ' ';
  cout << endl;
}
int32_t main() {
  long long a1, r, limit, m;
  cin >> a1 >> r >> limit >> m;
  unordered_map<long long, bool> bad;
  for (long long i = 0; i < (long long)(m); ++i) {
    long long temp;
    cin >> temp;
    bad[temp] = true;
  }
  if (r == 1) {
    if (bad[a1]) {
      cout << 0 << endl;
      return 0;
    } else {
      if (abs(a1) <= limit) {
        cout << "inf" << endl;
        return 0;
      } else {
        cout << 0 << endl;
        return 0;
      }
    }
  } else if (r == 0) {
    if (abs(a1) > limit) {
      cout << 0 << endl;
      return 0;
    } else {
      if (bad[a1]) {
        if (bad[0]) {
          cout << 0 << endl;
          return 0;
        } else {
          cout << "inf" << endl;
          return 0;
        }
      } else {
        if (bad[0]) {
          cout << 1 << endl;
          return 0;
        } else {
          cout << "inf" << endl;
          return 0;
        }
      }
    }
  } else if (r == -1) {
    if (abs(a1) <= limit) {
      if (bad[a1] && bad[-a1]) {
        cout << 0 << endl;
        return 0;
      } else if (bad[a1]) {
        cout << "inf" << endl;
        return 0;
      } else if (bad[-a1]) {
        cout << "inf" << endl;
        return 0;
      } else {
        cout << "inf" << endl;
        return 0;
      }
    } else {
      cout << 0 << endl;
      return 0;
    }
  } else {
    if (a1 != 0) {
      long long count = 0;
      while (abs(a1) <= limit) {
        if (!bad[a1]) {
          count++;
        }
        a1 *= r;
      }
      cout << count << endl;
    } else {
      if (bad[a1]) {
        cout << 0 << endl;
        return 0;
      } else {
        cout << "inf" << endl;
        return 0;
      }
    }
  }
  return 0;
}
