Problem: You are given a string S of length 2N consisting of lowercase English letters.

There are 2^{2N} ways to color each character in S red or blue. Among these ways, how many satisfy the following condition?

* The string obtained by reading the characters painted red from left to right is equal to the string obtained by reading the characters painted blue from right to left.

Constraints

* 1 \leq N \leq 18
* The length of S is 2N.
* S consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:


N
S


Output

Print the number of ways to paint the string that satisfy the condition.

Examples

Input

4
cabaacba


Output

4


Input

11
mippiisssisssiipsspiim


Output

504


Input

4
abcdefgh


Output

0


Input

18
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


Output

9075135300

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class Main {
    FastScanner in;
    PrintWriter out;

    void solve() {
        int n = in.nextInt();
        char[] s = in.next().toCharArray();
        Random rnd = new Random(123);
        long[] magic = new long[n];
        for (int i = 0; i < n; i++) {
            magic[i] = rnd.nextLong();
        }
        long[] magic2 = new long[n + 1];
        for (int i = 0; i <= n; i++) {
            magic2[i] = rnd.nextLong();
        }
        HashMap<Long, Integer> count = new HashMap<>();
        for (int mask = 0; mask < 1 << n; mask++) {
            long hash = 0;
            int it = 0, it2 = n - 1;
            for (int i = 0; i < n; i++) {
                if (((1 << i) & mask) != 0) {
                    hash += magic[it++] * s[i];
                } else {
                    hash += magic[it2--] * s[i];
                }
            }
            hash *= magic2[Integer.bitCount(mask)];
            Integer now = count.get(hash);
            if (now == null) {
                count.put(hash, 1);
            } else {
                count.put(hash, now + 1);
            }
        }
        long result = 0;
        for (int mask = 0; mask < 1 << n; mask++) {
            long hash = 0;
            int it = 0, it2 = n - 1;
            for (int i = 0; i < n; i++) {
                if (((1 << i) & mask) != 0) {
                    hash += magic[it++] * s[s.length - 1 - i];
                } else {
                    hash += magic[it2--] * s[s.length - 1 - i];
                }
            }
            hash *= magic2[Integer.bitCount(mask)];
            Integer now = count.get(hash);
            if (now != null) {
                result += now;
            }
        }
        out.println(result);
    }

    void run() {
        try {
            in = new FastScanner(new File("Main.in"));
            out = new PrintWriter(new File("Main.out"));

            solve();

            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    void runIO() {

        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

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

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

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

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

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

    public static void main(String[] args) {
        new Main().runIO();
    }
}