-100 0 50 1
0
 -1000 0 10 1
5
 -3 1 100 1
3
 1000000000 100000 1000000000 4
5433 13 6 0
 5 1 5 5
1 2 3 4 0
 2 -1 6 1
2
 3 2 30 3
-691070108 -934106649 -220744807
 0 8 5 1
9
 2 -1 1 1
1
 3 2 115 16
24 48 12 96 3 720031148 -367712651 -838596957 558177735 -963046495 -313322487 -465018432 -618984128 -607173835 144854086 178041956
 0 1 1 1
0
 -1000000000 -1000000000 1 1
232512888
 0 2 2143435 4
54343 -13 6 124
 0 69 12 1
1
 3 1 3 1
5
 0 5 8 1
10
 3 2 30 1
3
 2 -1 10 1
2
 -5 -1 10 1
-5
 -1 -1 2143435 4
-1 -123 -5453 141245
 11 0 228 5
-1 0 1 5 -11245
 123 -1 2143435 5
-123 0 123 -5453 141245
 2 2 4 1
2
 3 0 1 1
3
 0 4 1 1
2
 3 2 3 4
6 14 25 48
 3 2 25 2
379195692 -69874783
 -10 1 5 1
100
 1000000000 999999998 1000000000 1
0
 0 3 3 1
1
 1 0 2 1
1
 0 -3 2143435 5
-1 0 1 5 -11245
 11 0 1111 1
11
 2 0 3 1
2
 100 10 2 1
100
 0 5 10 1
2
 123 -1 10000 1
123
 1 5 10000 1
125
 123 0 2143435 4
5433 0 -123 -645
 11 0 228 5
-1 -17 1 5 -11245
 0 23 3 1
3
 3 0 3 1
4
 5 -1 3 1
0
 123 0 2143435 4
5433 0 123 -645
 2 -1 3 1
2
 2 -2 10 1
1
 -3 0 92055 36
-92974174 -486557474 -663622151 695596393 177960746 -563227474 -364263320 -676254242 -614140218 71456762 -764104225 705056581 -106398436 332755134 -199942822 -732751692 658942664 677739866 886535704 183687802 -784248291 -22550621 -938674499 637055091 -704750213 780395802 778342470 -999059668 -794361783 796469192 215667969 354336794 -60195289 -885080928 -290279020 201221317
 -1000 0 100 1
2
 123 -1 2143435 5
-123 0 12 5 -11245
 1 1 1000000000 1
100
 3 0 3 1
0
 1 0 2143435 4
1 -123 -5453 141245
 -3 0 1 1
-3
 2 0 2 1
-1
 123 -1 2143435 4
54343 -13 6 123
 -100 -1 1 1
1
 2 -1 100 1
2
 10 -1 2 1
1
 -1000 0 100 1
-1000
 0 3 100 1
5
 5 2 100 1
5
 -4 1 1 1
0
 -20 0 10 1
0
 -5 0 1 1
1
 10 -1 3 2
10 8
 0 35 2 1
3
 0 5 100 2
34 56
 11 0 2 5
-1 0 1 5 -11245
 0 2 100 1
5
 123 0 125 1
123
 100 0 100000 1
100
 1 -1 1 1
1
 1 -1 2143435 4
1 -123 -5453 141245
 2 2 4 1
3
 15 -1 15 4
15 -15 1 2
 3 2 24 4
6 14 25 48
 1 -1 2 1
1
 123 0 21 4
543453 -123 6 1424
 0 2 30 4
6 14 25 48
 10 10 10 1
123
 2 0 2 1
2
 0 4 1000 3
5 6 7
 -2 0 1 1
1
 0 10 10 1
2
 5 1 2 1
2
 3 3 104 17
9 -73896485 -290898562 5254410 409659728 -916522518 -435516126 94354167 262981034 -375897180 -80186684 -173062070 -288705544 -699097793 -11447747 320434295 503414250
 -10 0 5 1
0
 -3 1 100 1
-3
 0 8 10 1
5
 5 0 20 1
5
 0 0 2143435 5
-1 -153 1 5 -11245
 4 0 4 1
0
 2 0 1 1
2
 5 -1 100 1
5
 1 -2 1000000000 1
0
 0 2 5 1
1
 1 -1 10 1
1

0
 0
 inf
 1
 inf
 inf
 4
 inf
 0
 1
 0
 0
 inf
 inf
 inf
 inf
 3
 inf
 inf
 inf
 1
 0
 1
 0
 inf
 1
 4
 0
 1
 inf
 inf
 0
 inf
 inf
 0
 inf
 inf
 5
 1
 inf
 inf
 inf
 0
 0
 inf
 3
 inf
 0
 inf
 inf
 1
 inf
 0
 inf
 inf
 0
 inf
 0
 0
 inf
 4
 0
 0
 0
 0
 inf
 inf
 0
 inf
 inf
 inf
 inf
 inf
 2
 0
 3
 inf
 0
 inf
 1
 inf
 inf
 0
 inf
 0
 3
 0
 0
 inf
 inf
 inf
 1
 0
 inf
 30
 inf
 inf

#include <bits/stdc++.h>
using namespace std;
long long null = 0;
struct segment;
struct line;
struct point;
struct vec;
struct ray;
struct point {
  long double x, y;
  point() {}
  point(long double x1, long double y1) {
    x = x1;
    y = y1;
  }
  long double dist_to_point(point p) {
    return sqrt((p.x - x) * (p.x - x) + (p.y - y) * (p.y - y));
  }
  bool operator<(point p) { return (x < p.x) || ((x == p.x) && (y < p.y)); }
};
struct vec {
  long double x, y;
  vec(long double x1, long double y1) {
    x = x1;
    y = y1;
  }
  vec(point a, point b) {
    x = b.x - a.x;
    y = b.y - a.y;
  }
  vec normal() {
    vec ans;
    ans.x = y;
    ans.y = -x;
    return ans;
  }
  vec opposite() {
    vec ans;
    ans.x = -x;
    ans.y = -y;
    return ans;
  }
  vec sum(vec b) {
    vec ans;
    ans.x = x + b.x;
    ans.y = y + b.y;
    return ans;
  }
  long double cross_product(vec v) { return x * v.y - v.x * y; }
  long double dot_product(vec v) { return x * v.x + y * v.y; }
  vec resize(long double size) {
    vec ans;
    ans.x = (x * size) / len();
    ans.y = (y * size) / len();
    return ans;
  }
  vec() {}
  long double len() { return sqrt(x * x + y * y); }
};
struct line {
  long double a, b, c;
  line(point a1, point b1) {
    a = a1.y - b1.y;
    b = b1.x - a1.x;
    c = -a1.x * a - a1.y * b;
  }
  line(long double a1, long double b1, long double c1) {
    a = a1;
    b = b1;
    c = c1;
  }
  line() {}
  vec normal_vec() {
    vec ans;
    ans.x = a;
    ans.y = b;
    return ans;
  }
  line normal_line(point p) {
    line ans;
    ans.a = -b;
    ans.b = a;
    ans.c = -ans.a * p.x - ans.b * p.y;
    return ans;
  }
  long double get_x(long double y1) {
    if (a == 0) return 0;
    return (-c - b * y1) / a;
  }
  long double get_y(long double x1) {
    if (b == 0) return 0;
    return (-c - a * x1) / b;
  }
  point intersection(line l) {
    point ans;
    ans.x = (-c * l.b + l.c * b) / (a * l.b - l.a * b);
    ans.y = (-a * l.c + l.a * c) / (a * l.b - l.a * b);
    return ans;
  }
  long double dist_to_point(point p) {
    return abs((a * p.x + b * p.y + c) / (sqrt(a * a + b * b)));
  }
  long long is_inside(point p) {
    long double k = a * p.x + b * p.y + c;
    if (k < 0)
      return -1;
    else if (k == 0)
      return 0;
    return 1;
  }
};
struct segment {
  point a, b;
  segment() {}
  segment(point a1, point b1) {
    a = a1;
    b = b1;
  }
  long double len() {
    return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
  }
  bool is_inside(point p) {
    line l(a, b);
    if (l.is_inside(p) != 0) return false;
    vec v(p, a), v1(p, b);
    if (v.dot_product(v1) > 0) return false;
    return true;
  }
  long double dist_to_point(point p) {
    vec v(a, p), v1(a, b), v2(b, p), v3(b, a);
    if (v.dot_product(v1) < 0) return p.dist_to_point(a);
    if (v2.dot_product(v3) < 0) return p.dist_to_point(b);
    line l(a, b);
    return l.dist_to_point(p);
  }
  point get_center() {
    point ans;
    ans.x = (a.x + b.x) / 2;
    ans.y = (a.y + b.y) / 2;
    return ans;
  }
};
struct ray {
  point a, b;
  ray(point p, point p1) {
    a = p;
    b = p1;
  }
  ray() {}
  long double dist_to_point(point p) {
    vec v(a, p), v1(a, b);
    if (v.dot_product(v1) < 0) return a.dist_to_point(p);
    line l(a, b);
    return l.dist_to_point(p);
  }
  bool is_inside(point p) {
    line l(a, b);
    if (l.is_inside(p) != 0) return false;
    vec v(a, p), v1(a, b);
    if (v.dot_product(v1) < 0) return false;
    return true;
  }
};
struct angle {
  point a, b, c;
  angle(){};
  angle(point a1, point b1, point c1) {
    a = a1;
    b = b1;
    c = c1;
  }
  long double get_angle() {
    vec v(b, a), v1(b, c);
    cout << v.dot_product(v1) << " " << v.len() << " " << v1.len() << endl;
    return acos(v.dot_product(v1) / (v.len() * v1.len()));
  }
};
struct polygon {
  long long n;
  vector<point> points;
  long double get_area() {
    point a(0, 0);
    vec v(a, points[0]);
    long double ans = 0;
    for (long long i = 1; i < n; ++i) {
      vec v1(a, points[i]);
      ans = ans + v.cross_product(v1);
      v = v1;
    }
    vec v2(a, points[0]);
    vec v1(a, points[n - 1]);
    return abs(ans + v1.cross_product(v2)) / 2;
  }
};
struct triangle {
  point a, b, c;
  triangle() {}
  triangle(point a1, point b1, point c1) {
    a = a1;
    b = b1;
    c = c1;
  }
  long double get_area() {
    point d(0, 0);
    vec v(a, d), v1(b, d), v2(c, d);
    return (v.cross_product(v1) + v1.cross_product(v2) + v2.cross_product(v)) /
           2;
  }
  point get_center() {
    segment s(a, b), s1(a, c);
    point p = s.get_center(), p1 = s1.get_center();
    line l(a, b), l1(a, c), l2(b, c);
    l = l.normal_line(p);
    l1 = l1.normal_line(p1);
    return l.intersection(l1);
  }
  long double get_R() {
    triangle t(a, b, c);
    point p = t.get_center();
    return p.dist_to_point(a);
  }
};
long long power(long long a, long long b) {
  if (b == 0)
    return 1;
  else if (b == 1)
    return a;
  else {
    long long k = power(a, b / 2);
    return k * k * power(a, b % 2);
  }
}
long long power_mod(long long a, long long b, long long MOD) {
  if (b == 0)
    return 1;
  else if (b == 1)
    return a % MOD;
  else {
    long long k = power_mod(a, b / 2, MOD);
    return ((k * k) % MOD * power_mod(a, b % 2, MOD)) % MOD;
  }
}
long long sum_mod(long long a, long long b, long long MOD) {
  return (a + b) % MOD;
}
long long mul_mod(long long a, long long b, long long MOD) {
  return (a * b) % MOD;
}
long long ord(char a) { return a; }
char chr(long long a) { return a; }
long long strtoint(string s) {
  long long ans = 0;
  for (long long i = 0; i < s.size(); ++i) {
    ans *= 10;
    ans += ord(s[i]) - 48;
  }
  return ans;
}
string rev_string(string s) {
  string ans = "";
  for (long long i = s.size(); i >= 0; --i) {
    ans += s[i];
  }
  return ans;
}
string inttostr(long long a) {
  string ans = "", ans1 = "";
  while (a > 0) {
    ans += chr(a + 48);
    a /= 10;
  }
  for (long long i = ans.size() - 1; i >= 0; --i) {
    ans1 += ans[i];
  }
  return ans1;
}
set<long long> ar;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  long long b, q, l, m;
  cin >> b >> q >> l >> m;
  for (long long i = 0; i < m; ++i) {
    long long a;
    cin >> a;
    ar.insert(a);
  }
  long long ans;
  long long k = 0;
  while (abs(b) <= l) {
    ++k;
    if (k > 100) {
      if (ans > 1)
        cout << "inf";
      else
        cout << ans;
      exit(0);
    }
    if (ar.find(b) == ar.end()) ++ans;
    b *= q;
  }
  cout << ans;
}
