You are given an array a, consisting of n positive integers.

Let's call a concatenation of numbers x and y the number that is obtained by writing down numbers x and y one right after another without changing the order. For example, a concatenation of numbers 12 and 3456 is a number 123456.

Count the number of ordered pairs of positions (i, j) (i ≠ j) in array a such that the concatenation of a_i and a_j is divisible by k.

Input

The first line contains two integers n and k (1 ≤ n ≤ 2 ⋅ 10^5, 2 ≤ k ≤ 10^9).

The second line contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9).

Output

Print a single integer — the number of ordered pairs of positions (i, j) (i ≠ j) in array a such that the concatenation of a_i and a_j is divisible by k.

Examples

Input

6 11
45 1 10 12 11 7


Output

7


Input

4 2
2 78 4 10


Output

12


Input

5 2
3 7 19 3 3


Output

0

Note

In the first example pairs (1, 2), (1, 3), (2, 3), (3, 1), (3, 4), (4, 2), (4, 3) suffice. They produce numbers 451, 4510, 110, 1045, 1012, 121, 1210, respectively, each of them is divisible by 11.

In the second example all n(n - 1) pairs suffice.

In the third example no pair is sufficient.
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class Code {
    static boolean skip = false;

    public static void main(String[] args) throws IOException {
        // Use the Scanner class
        MyScanner sc = new MyScanner();
        // FastScanner sc = new FastScanner(System.in);
        out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = sc.nextInt();
        int k = sc.nextInt();
        long[] A = new long[n];
        long max = 0;
        for (int i = 0; i < n; ++i) {
            A[i] = sc.nextInt();
            max = Math.max(max, A[i]);
        }
        int l_max =  (int) (1 + Math.log10(max));
        Map<Integer, Map<Long,Integer>> freq = new HashMap<>();
//        int[][] freq = new int[1 + l_max][k];
        long factor = 10;
        for (int l = 1; l <= l_max; ++l) {
            freq.put(l, new HashMap<>());
            for (int i = 0; i < n; ++i) {
                freq.get(l).put(((A[i] % k) * factor) % k, 1 + freq.get(l).getOrDefault(((A[i] % k) * factor) % k, 0));
            }
            factor *= 10;
            factor %= k;
        }
        long ans = 0;
        for (int i = 0; i < n; ++i) {
            long x = A[i] % k;
            long y = k - x;
            y = y % k;
            int l = (int) (1 + Math.log10(A[i]));
            ans += freq.get(l).getOrDefault(y, 0);
            long pow = Long.valueOf( (long) (Math.pow(10, l) % k));
            if ((x * pow)% k == y) {
               ans--;
            }
        }
        System.out.println(ans);

    }

    public static String solve(String S, int k) {
        String part = S;
        for (int i = 1; i < S.length(); ++i) {
            String substr = S.substring(i);
            if (S.startsWith(substr)) {
                part = S.substring(substr.length());
                break;
            }
        }
        StringBuilder res = new StringBuilder(S);
        for (int i = 0; i < k - 1; ++i) {
            res.append(part);
        }
        return res.toString();
    }

    static class Pair {
        int key;
        int value;

        public Pair(int key, int value) {
            this.key = key;
            this.value = value;
        }
    }
    public static PrintWriter out;

    // -----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

    static public class FastScanner {

        static final int DEFAULT_BUFF = 10240, EOF = -1, INT_MIN = 48, INT_MAX = 57;
        static final byte NEG = 45;
        static final int[] ints = new int[58];

        static {
            int value = 0;
            for (int i = 48; i < 58; i++) {
                ints[i] = value++;
            }
        }

        InputStream stream;

        byte[] buff;
        int buffPtr;

        public FastScanner(InputStream stream) {
            this.stream = stream;
            this.buff = new byte[DEFAULT_BUFF];
            this.buffPtr = -1;
        }

        public int nextInt() throws IOException {
            int val = 0;
            int sign = readNonDigits();
            while (isDigit(buff[buffPtr]) && buff[buffPtr] != EOF) {
                val = (val << 3) + (val << 1) + ints[buff[buffPtr]];
                buffPtr++;
                if (buffPtr == buff.length) {
                    updateBuff();
                }
            }
            return val * sign;
        }

        private int readNonDigits() throws IOException {
            if (buffPtr == -1 || buffPtr == buff.length) {
                updateBuff();
            }
            if (buff[buffPtr] == EOF) {
                throw new IOException("End of stream reached");
            }
            int signByte = -1;
            while (!isDigit(buff[buffPtr])) {
                signByte = buff[buffPtr];
                buffPtr++;
                if (buffPtr >= buff.length) {
                    updateBuff();
                }
                if (buff[buffPtr] == EOF) {
                    throw new IOException("End of stream reached");
                }
            }
            if (signByte == NEG)
                return -1;
            return 1;
        }

        public void close() throws IOException {
            stream.close();
        }

        private boolean isDigit(int b) {
            return b >= INT_MIN && b <= INT_MAX;
        }

        private void updateBuff() throws IOException {
            buffPtr = 0;
            stream.read(buff);
        }
    }
}