Vova again tries to play some computer card game.

The rules of deck creation in this game are simple. Vova is given an existing deck of n cards and a magic number k. The order of the cards in the deck is fixed. Each card has a number written on it; number ai is written on the i-th card in the deck.

After receiving the deck and the magic number, Vova removes x (possibly x = 0) cards from the top of the deck, y (possibly y = 0) cards from the bottom of the deck, and the rest of the deck is his new deck (Vova has to leave at least one card in the deck after removing cards). So Vova's new deck actually contains cards x + 1, x + 2, ... n - y - 1, n - y from the original deck.

Vova's new deck is considered valid iff the product of all numbers written on the cards in his new deck is divisible by k. So Vova received a deck (possibly not a valid one) and a number k, and now he wonders, how many ways are there to choose x and y so the deck he will get after removing x cards from the top and y cards from the bottom is valid?

Input

The first line contains two integers n and k (1 ≤ n ≤ 100 000, 1 ≤ k ≤ 109).

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the numbers written on the cards.

Output

Print the number of ways to choose x and y so the resulting deck is valid.

Examples

Input

3 4
6 2 8


Output

4


Input

3 6
9 1 14


Output

1

Note

In the first example the possible values of x and y are:

  1. x = 0, y = 0; 
  2. x = 1, y = 0; 
  3. x = 2, y = 0; 
  4. x = 0, y = 1. 
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (PloadyFree@gmail.com)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        private long k;
        private long[] leftq;
        private long[] rightq;
        private long[] leftprod;
        private long[] rightprod;
        private int leftsize;
        private int rightsize;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            k = in.readInt();
            int[] a = IOUtils.readIntArray(in, n);

            leftq = new long[n];
            rightq = new long[n];
            leftprod = new long[n];
            rightprod = new long[n];

            long ans = 0;
            for (int r = 0; ; pop()) {
                while (r < n && getProd() > 0) {
                    push(a[r++]);
                }
                if (getProd() != 0) {
                    break;
                }
                ans += n - r + 1;
            }

            out.print(ans);
        }

        private long getProd() {
            long p = 1;
            if (leftsize > 0) {
                p = leftprod[leftsize - 1];
            }
            if (rightsize > 0) {
                p = (p * rightprod[rightsize - 1]) % k;
            }
            return p;
        }

        private void push(long val) {
            rightq[rightsize] = val;
            long prev = rightsize == 0 ? 1 : rightprod[rightsize - 1];
            rightprod[rightsize] = (prev * val) % k;
            rightsize++;
        }

        private void pop() {
            if (leftsize == 0) {
                shift();
            }
            leftsize--;
        }

        private void shift() {
            while (rightsize > 0) {
                leftq[leftsize++] = rightq[--rightsize];
            }
            leftprod[0] = leftq[0] % k;
            for (int i = 1; i < leftsize; i++) {
                leftprod[i] = (leftprod[i - 1] * leftq[i]) % k;
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void print(long i) {
            writer.print(i);
        }

    }

    static class IOUtils {
        public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = in.readInt();
            }
            return array;
        }

    }
}

