#include <bits/stdc++.h>
using namespace std;
long long b[100015], q, l, m, c = 1, a[100015], cb, ans;
int main() {
  scanf("%I64d%I64d%I64d%I64d", &a[1], &q, &l, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%I64d", &b[i]);
  }
  if (abs(a[1]) > l) {
    cout << "0" << endl;
    return 0;
  }
  if (a[1] == 0) {
    for (int j = 1; j <= m; j++) {
      if (b[j] == a[1]) {
        ans++;
      }
    }
    if (ans > 0) {
      cout << "0" << endl;
    } else {
      cout << "inf" << endl;
    }
  } else if (q == 0) {
    for (int j = 1; j <= m; j++) {
      if (b[j] == a[1]) {
        ans++;
      } else if (b[j] == q) {
        ans += 2;
      }
    }
    if (ans == 1) {
      cout << "inf" << endl;
    } else if (ans == 2) {
      cout << "1" << endl;
    } else if (ans == 3) {
      cout << "0" << endl;
    } else if (ans == 0) {
      cout << "inf" << endl;
    }
  } else if (q == -1) {
    for (int j = 1; j <= m; j++) {
      if (b[j] == a[1] || b[j] == -a[1]) {
        ans++;
      }
    }
    if (ans > 1) {
      cout << "0" << endl;
    } else {
      cout << "inf" << endl;
    }
  } else if (q == 1) {
    for (int j = 1; j <= m; j++) {
      if (b[j] == a[1]) {
        ans++;
      }
    }
    if (ans > 0) {
      cout << "0" << endl;
    } else {
      cout << "inf" << endl;
    }
  } else if (abs(q) > 1) {
    while (abs(a[c]) <= l) {
      c++;
      a[c] = a[c - 1] * q;
    }
    c--;
    for (int i = 1; i <= c; i++) {
      for (int j = 1; j <= m; j++) {
        if (a[i] == b[j]) {
          ans++;
        }
      }
    }
    cout << c - ans << endl;
  }
  return 0;
}
