#include <bits/stdc++.h>
using namespace std;
map<long long, bool> my;
long long abso(long long n) {
  if (n > 0) return n;
  return -n;
}
int main() {
  long long b, q, l, m, a;
  cin >> b >> q >> l >> m;
  int i;
  for (i = 0; i < m; i++) {
    cin >> a;
    my[a] = 1;
  }
  if (abso(b) > l) {
    cout << "0\n";
    return 0;
  }
  if (q == 0) {
    if (b == 0) {
      if (my[0] != 1) {
        cout << "inf\n";
        return 0;
      }
      if (my[0] == 1) {
        cout << "0\n";
        return 0;
      }
    } else {
      if (my[b] == 1 && my[0] == 1) {
        cout << "0\n";
        return 0;
      }
      if (abso(b) <= l) {
        if (my[0] == 1 && my[b] != 1) {
          cout << "1\n";
          return 0;
        }
        if (my[0] != 1) {
          cout << "inf\n";
          return 0;
        }
      }
    }
  }
  if (q == 1) {
    if (my[b] == 1 || l < b) {
      cout << "0\n";
      return 0;
    }
    if (l >= b) {
      cout << "inf\n";
      return 0;
    }
  }
  if (q == -1) {
    if (my[b] == 1 && my[-b] == 1) {
      cout << "0\n";
      return 0;
    }
    if (abs(b) <= l) {
      cout << "inf\n";
      return 0;
    }
  }
  if (b == 0) {
    if (my[0] != 1) {
      cout << "inf\n";
      return 0;
    } else {
      cout << "0\n";
      return 0;
    }
  }
  long long ans = b, c = 0;
  while (abso(ans) <= l) {
    if (my[ans] != 1) c++;
    ans = ans * q;
  }
  cout << c << endl;
  return 0;
}
