Masha really loves algebra. On the last lesson, her strict teacher Dvastan gave she new exercise.

You are given geometric progression b defined by two integers b1 and q. Remind that a geometric progression is a sequence of integers b1, b2, b3, ..., where for each i > 1 the respective term satisfies the condition bi = bi - 1·q, where q is called the common ratio of the progression. Progressions in Uzhlyandia are unusual: both b1 and q can equal 0. Also, Dvastan gave Masha m "bad" integers a1, a2, ..., am, and an integer l.

Masha writes all progression terms one by one onto the board (including repetitive) while condition |bi| ≤ l is satisfied (|x| means absolute value of x). There is an exception: if a term equals one of the "bad" integers, Masha skips it (doesn't write onto the board) and moves forward to the next term.

But the lesson is going to end soon, so Masha has to calculate how many integers will be written on the board. In order not to get into depression, Masha asked you for help: help her calculate how many numbers she will write, or print "inf" in case she needs to write infinitely many integers.

Input

The first line of input contains four integers b1, q, l, m (-109 ≤ b1, q ≤ 109, 1 ≤ l ≤ 109, 1 ≤ m ≤ 105) — the initial term and the common ratio of progression, absolute value of maximal number that can be written on the board and the number of "bad" integers, respectively.

The second line contains m distinct integers a1, a2, ..., am (-109 ≤ ai ≤ 109) — numbers that will never be written on the board.

Output

Print the only integer, meaning the number of progression terms that will be written on the board if it is finite, or "inf" (without quotes) otherwise.

Examples

Input

3 2 30 4
6 14 25 48


Output

3

Input

123 1 2143435 4
123 11 -5453 141245


Output

0

Input

123 1 2143435 4
54343 -13 6 124


Output

inf

Note

In the first sample case, Masha will write integers 3, 12, 24. Progression term 6 will be skipped because it is a "bad" integer. Terms bigger than 24 won't be written because they exceed l by absolute value.

In the second case, Masha won't write any number because all terms are equal 123 and this is a "bad" integer.

In the third case, Masha will write infinitely integers 123. 
#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;
}
