//some updates in import stuff
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import java.util.*;
import java.io.*;
import java.math.*;

//key points learned
//max space ever that could be alloted in a program to pass in cf
//int[][] prefixSum = new int[201][200_005];   -> not a single array more!!!
//never allocate memory again again to such bigg array, it will give memory exceeded for sure
//believe in your fucking solution and keep improving it!!! (sometimes)

public class Main{

    static int mod = (int) (Math.pow(10, 9)+7);
	static final int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
	static final int[] dx8 = { -1, -1, -1, 0, 0, 1, 1, 1 }, dy8 = { -1, 0, 1, -1, 1, -1, 0, 1 };
	static final int[] dx9 = { -1, -1, -1, 0, 0, 0, 1, 1, 1 }, dy9 = { -1, 0, 1, -1, 0, 1, -1, 0, 1 };

	static final double eps = 1e-10;
	static List<Integer> primeNumbers = new ArrayList<>();
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        //code below
        String str = sc.nextLine();
        char[] inp = str.toCharArray();
        int n = str.length();

        //since i have the input ready bois
        //keep solving until, there is no until keep solving bruh!! (simple)
        String[] pos = {"00", "25", "50", "75"};
        int count = 0;

        if(inp.length == 1){
            if(inp[0] == '0' || inp[0] == 'X' || inp[0] == '_') count++;
        }else{

            for(String cstr : pos){
                int X = -1;

                int idx = 0;
                boolean possible = true;
                for(int i = n-2; i < n; i++){
                    char curr = inp[i];
                    char strcurr = cstr.charAt(idx);

                    if(curr == '_') continue;
                    else if(curr == 'X'){
                        if(X == -1){
                            X = (strcurr - '0');
                        }else{
                            if(X != strcurr - '0'){
                                possible = false;
                                break;
                            }
                        }
                    }else{
                        if(curr != strcurr){
                            possible = false;
                            break;
                        }
                    }

                    idx++;
                }

                if(!possible) continue; //don't increase the count simple

                //to handle one small edge case which was this
                if(str.length() == 2){
                    if(cstr.compareTo("00") == 0) continue;
                    count++;
                    continue;
                }

                //now yaha tak question done hai boss for sure!! We have the required X and stuff and all
                //now make all possible outcomes for X
                //if X == -1 && X == 0 else what else we can do?? - think about it for sure
                //if X is fixed , then simple
                //if X is zero then also simple
                //if X is not fixed, and X is not zero
                //make temp inp
                char[] ninp = Arrays.copyOf(inp, str.length());

                int cntX = 0;
                for(char ch : inp){
                    if(ch == 'X') cntX++;
                }

                if(X != -1 || cntX == 0){
                    if(X != -1){
                        for(int k = 0; k < str.length(); k++){
                            ninp[k] = inp[k] == 'X' ? (char)(X + '0') : inp[k];
                        }
                    }

                    if(ninp[0] == '0') continue;
                    int counter = 1;
                    for(int k = 0; k < str.length() - 2; k++){
                        if(ninp[k] == '_'){
                            if(k == 0){
                                counter = counter * 9;
                            }else{
                                counter = counter * 10;
                            }
                        }
                    }

                    count += counter;
                }else{

                    if(ninp[0] == '0') continue;  //simimlar to before

                    //now either 'X' or '_' or
                    int counter = 1;
                    for(int k = 0; k < str.length() - 2; k++){
                        if(ninp[k] == '_'){
                            if(k == 0){
                                counter = counter * 9;
                            }else{
                                counter = counter * 10;
                            }
                        }
                    }

                    //after this it is pretty simple, multiply X also
                    if(ninp[0] == 'X'){
                        counter = counter * 9;
                    }else{
                        counter = counter * 10;
                    }

                    count += counter;
                }
            }
        }

        System.out.println(count);

        out.close();
    }

    //new stuff to learn (whenever this is need for them, then only)
    //Lazy Segment Trees
    //Persistent Segment Trees
    //Square Root Decomposition
    //Geometry & Convex Hull
    //High Level DP -- yk yk
    //String Matching Algorithms
    //Heavy light Decomposition

    //Updation Required
    //Fenwick Tree - both are done (sum)
    //Segment Tree - both are done (min, max, sum)

    //-----CURRENTLY PRESENT-------//
    //Graph
    //DSU
    //powerMODe
    //power
    //Segment Tree (work on this one)
    //Prime Sieve
    //Count Divisors
    //Next Permutation
    //Get NCR
    //isVowel
    //Sort (int)
    //Sort (long)
    //Binomial Coefficient
    //Pair
    //Triplet
    //lcm (int & long)
    //gcd (int & long)
    //gcd (for binomial coefficient)
    //swap (int & char)
    //reverse
    //primeExponentCounts

    //Fast input and output

    //-------------------------------------------------------------------
    //-------------------------------------------------------------------
    //-------------------------------------------------------------------
    //-------------------------------------------------------------------
    //-------------------------------------------------------------------

    //GRAPH (basic structure)
    public static class Graph{
        public int V;
        public ArrayList<ArrayList<Integer>> edges;

        //2 -> [0,1,2] (current)
        Graph(int V){
            this.V  = V;
            edges = new ArrayList<>(V+1);
            for(int i= 0; i <= V; i++){
                edges.add(new ArrayList<>());
            }
        }

        public void addEdge(int from , int to){
            edges.get(from).add(to);
            edges.get(to).add(from);
        }
    }

    //DSU (path and rank optimised)
    public static class DisjointUnionSets {
        int[] rank, parent;
        int n;

        public DisjointUnionSets(int n)
        {
            rank = new int[n];
            parent = new int[n];
            Arrays.fill(rank, 1);
            Arrays.fill(parent,-1);
            this.n = n;
        }

        public int find(int curr){
            if(parent[curr] == -1)
                return curr;

            //path compression optimisation
            return parent[curr] = find(parent[curr]);
        }

        public void union(int a, int b){
            int s1 = find(a);
            int s2 = find(b);

            if(s1 != s2){
                //union by size
                if(rank[s1] < rank[s2]){
                    parent[s1] = s2;
                    rank[s2] += rank[s1];
                }else{
                    parent[s2] = s1;
                    rank[s1] += rank[s2];
                }
            }
        }
    }

    //with mod
    public static long powerMOD(long x, long y)
    {
        long res = 1L;
        while (y > 0)
        {
            // If y is odd, multiply x with result
            if ((y & 1) != 0){
                x %= mod;
                res %= mod;
                res = (res * x)%mod;
            }
            // y must be even now
            y = y >> 1; // y = y/2
            x%= mod;
            x = (x * x)%mod;  // Change x to x^2
        }
        return res%mod;
    }

    //without mod
    public static long power(long x, long y)
    {
        long res = 1L;
        while (y > 0)
        {
            // If y is odd, multiply x with result
            if ((y & 1) != 0){
                res = (res * x);
            }
            // y must be even now
            y = y >> 1; // y = y/
            x = (x * x);
        }
        return res;
    }

    public static class segmentTree{

        //so let's make a constructor function for this bad boi for sure!!!
        public long[] arr;
        public long[] tree;

        //COMPLEXITY (normal segment tree, stuff)
        //build -> O(n)
        //query -> O(logn)
        //update -> O(logn)
        //update-range -> O(n) (worst case)

        //simple iteration and stuff for sure
        public segmentTree(long[] arr){
            int n = arr.length;
            this.arr = new long[n];
            for(int i= 0; i < n; i++){
                this.arr[i] = arr[i];
            }

            tree = new long[4*n + 1];
        }

        //pretty basic idea if you read the code once
        //first make child node once
        //then form the parent node using them
        public void buildTree(int s, int e, int index){
            if(s == e){
                tree[index] = arr[s];
                return;
            }

            //recursive case
            int mid = (s + e)/2;
            buildTree(s, mid, 2 * index);
            buildTree(mid + 1, e, 2*index + 1);

            //the condition we want from children be like this
            tree[index] = min(tree[2 * index], tree[2 * index + 1]);
            return;
        }

        //definitely index based 0 query!!!
        //only int index = 1!!
        //baaki everything is simple as fuck
        public long query(int s, int e, int qs , int qe, int index){
            //complete overlap
            if(s >= qs && e <= qe){
                return tree[index];
            }

            //no overlap
            if(qe < s || qs > e){
                return Long.MAX_VALUE;
            }

            //partial overlap
            int mid = (s + e)/2;
            long left = query( s, mid , qs, qe, 2*index);
            long right = query( mid + 1, e, qs, qe, 2*index + 1);

            return min(left, right);
        }

        //updates are pretty cool
        //point update and range update!!!
        public void updateNode(int s, int e, int i, long increment, int index){

            //case where I is out of bounds
            if(i < s || i > e){
                return;
            }

            if(s == e){
                //making increment
                tree[index] += increment;
                return;
            }

            //otherwise
            int mid = (s + e)/2;
            updateNode(s, mid, i, increment, 2 * index);
            updateNode(mid + 1, e, i, increment, 2 * index + 1);

            tree[index] = min(tree[2 * index], tree[2 * index + 1]);
            return;
        }

        //gonna do range updates for sure now!!
        //let's do this bois!!! (solve this problem for sure)
        public void updateRange(int s, int e, int l, int r, long increment, int index){

            //out of bounds
            if(l > e || r < s){
                return;
            }

            //leaf node
            if(s == e){
                tree[index] += increment;
            }

            //recursive case
            int mid = (s + e)/2;
            updateRange(s, mid, l, r, increment, 2 * index);
            updateRange(mid + 1, e, l, r, increment, 2 * index);

            tree[index] = min(tree[2 * index], tree[2 * index + 1]);
        }

    }

    //prime sieve
    public static void primeSieve(int n){
        BitSet bitset = new BitSet(n+1);
        for(long i = 0; i < n ; i++){
            if (i == 0 || i == 1) {
                bitset.set((int) i);
                continue;
            }
            if(bitset.get((int) i)) continue;
            primeNumbers.add((int)i);
            for(long j = i; j <= n ; j+= i)
                bitset.set((int)j);
        }
    }

    //number of divisors
    public static int countDivisors(long number){
        if(number == 1) return 1;
        List<Integer> primeFactors = new ArrayList<>();
        int index = 0;
        long curr = primeNumbers.get(index);
        while(curr * curr <= number){
            while(number % curr == 0){
                number = number/curr;
                primeFactors.add((int) curr);
            }
            index++;
            curr = primeNumbers.get(index);
        }

        if(number != 1) primeFactors.add((int) number);
        int current = primeFactors.get(0);
        int totalDivisors = 1;
        int currentCount = 2;
        for (int i = 1; i < primeFactors.size(); i++) {
            if (primeFactors.get(i) == current) {
                currentCount++;
            } else {
                totalDivisors *= currentCount;
                currentCount = 2;
                current = primeFactors.get(i);
            }
        }
        totalDivisors *= currentCount;
        return totalDivisors;
    }

    //primeExponentCounts
    public static int primeExponentsCount(int n) {
        if (n <= 1)
            return 0;
        int sqrt = (int) Math.sqrt(n);
        int remainingNumber = n;
        int result = 0;
        for (int i = 2; i <= sqrt; i++) {
            while (remainingNumber % i == 0) {
                result++;
                remainingNumber /= i;
            }
        }
        //in case of prime numbers this would happen
        if (remainingNumber > 1) {
            result++;
        }
        return result;
    }

    //now adding next permutation function to java hehe
    public static boolean next_permutation(int[] p) {
        for (int a = p.length - 2; a >= 0; --a)
          if (p[a] < p[a + 1])
            for (int b = p.length - 1;; --b)
              if (p[b] > p[a]) {
                int t = p[a];
                p[a] = p[b];
                p[b] = t;
                for (++a, b = p.length - 1; a < b; ++a, --b) {
                  t = p[a];
                  p[a] = p[b];
                  p[b] = t;
                }
                return true;
              }
        return false;
    }

    //finding the value of NCR in O(RlogN) time and O(1) space
    public static long getNcR(int n, int r)
    {
        long p = 1, k = 1;
        if (n - r < r) r = n - r;

        if (r != 0) {
            while (r > 0) {
                p *= n;
                k *= r;
                long m = __gcd(p, k);
                p /= m;
                k /= m;
                n--;
                r--;
            }
        }
        else {
            p = 1;
        }
        return p;
    }

    //is vowel function
    public static boolean isVowel(char c)
    {
        return (c=='a' || c=='A' || c=='e' || c=='E' || c=='i' || c=='I' || c=='o' || c=='O' ||     c=='u' || c=='U');
    }

    //to sort the array with better method
	public static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}

    //sort long
    public static void sort(long[] a) {
		ArrayList<Long> l=new ArrayList<>();
		for (long i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}

    //for calculating binomialCoeff
    public static int binomialCoeff(int n, int k)
    {
        int C[] = new int[k + 1];
        // nC0 is 1
        C[0] = 1;
        for (int i = 1; i <= n; i++) {
            // Compute next row of pascal
            // triangle using the previous row
            for (int j = Math.min(i, k); j > 0; j--)
                C[j] = C[j] + C[j - 1];
        }
        return C[k];
    }

    //Pair with int int
    public static class Pair{
        public int a;
        public int b;
        public int hashCode;

        Pair(int a , int b){
            this.a = a;
            this.b = b;
            this.hashCode = Objects.hash(a, b);
        }

        @Override
        public String toString(){
            return a + " -> " + b;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o)
                return true;
            if (o == null || getClass() != o.getClass())
                return false;
            Pair that = (Pair) o;
            return a == that.a && b == that.b;
        }

        @Override
        public int hashCode() {
            return this.hashCode;
        }
    }

    //Triplet with int int int
    public static class Triplet{

        public int a;
        public int b;
        public int c;

        Triplet(int a , int b, int c){
            this.a = a;
            this.b = b;
            this.c = c;
        }

        @Override
        public String toString(){
            return a + " -> " + b;
        }
    }

    //Shortcut function
    public static long lcm(long a , long b){
        return a * (b/gcd(a,b));
    }

    //let's make one for calculating lcm basically
    public static int lcm(int a , int b){
        return (a * b)/gcd(a,b);
    }

    //int version for gcd
    public static int gcd(int a, int b){
        if(b == 0)
            return a;

        return gcd(b , a%b);
    }

    //long version for gcd
    public static long gcd(long a, long b){
        if(b == 0)
            return a;

        return gcd(b , a%b);
    }

     //for ncr calculator(ignore this code)
     public static long __gcd(long n1, long n2)
     {
         long gcd = 1;
         for (int i = 1; i <= n1 && i <= n2; ++i) {
             // Checks if i is factor of both integers
             if (n1 % i == 0 && n2 % i == 0) {
                 gcd = i;
             }
         }
         return gcd;
     }

    //swapping two elements in an array
    public static void swap(int[] arr, int left , int right){
        int temp = arr[left];
        arr[left] = arr[right];
        arr[right] = temp;
    }

    //for char array
    public static void swap(char[] arr, int left , int right){
        char temp = arr[left];
        arr[left] = arr[right];
        arr[right] = temp;
    }

    //reversing an array
    public static void reverse(int[] arr){
        int left = 0;
        int right = arr.length-1;

        while(left <= right){
            swap(arr, left,right);
            left++;
            right--;
        }
    }

    public static long expo(long a, long b, long mod) {
        long res = 1;
        while (b > 0) {
            if ((b & 1) == 1L) res = (res * a) % mod;  //think about this one for a second
            a = (a * a) % mod;
            b = b >> 1;
        }
        return res;
    }

    //SOME EXTRA DOPE FUNCTIONS
    public static long mminvprime(long a, long b) {
        return expo(a, b - 2, b);
    }

    public static long mod_add(long a, long b, long m) {
        a = a % m;
        b = b % m;
        return (((a + b) % m) + m) % m;
    }

    public static long mod_sub(long a, long b, long m) {
        a = a % m;
        b = b % m;
        return (((a - b) % m) + m) % m;
    }

    public static long mod_mul(long a, long b, long m) {
        a = a % m;
        b = b % m;
        return (((a * b) % m) + m) % m;
    }

    public static long mod_div(long a, long b, long m) {
        a = a % m;
        b = b % m;
        return (mod_mul(a, mminvprime(b, m), m) + m) % m;
    }

    //O(n) every single time remember that
    public static long nCr(long N, long K , long mod){
        long upper = 1L;
        long lower = 1L;
        long lowerr = 1L;

        for(long i = 1; i <= N; i++){
            upper = mod_mul(upper, i, mod);
        }

        for(long i = 1; i <= K; i++){
            lower = mod_mul(lower, i, mod);
        }

        for(long i = 1; i <= (N - K); i++){
            lowerr = mod_mul(lowerr, i, mod);
        }

        // out.println(upper + " " + lower + " " + lowerr);
        long answer = mod_mul(lower, lowerr, mod);
        answer = mod_div(upper, answer, mod);

        return answer;
    }

    // long[] fact = new long[2 * n + 1];
    // long[] ifact = new long[2 * n + 1];
    // fact[0] = 1;
    // ifact[0] = 1;
    // for (long i = 1; i <= 2 * n; i++)
    // {
    //     fact[(int)i] = mod_mul(fact[(int)i - 1], i, mod);
    //     ifact[(int)i] = mminvprime(fact[(int)i], mod);
    // }
    //ifact is basically inverse factorial in here!!!!!(imp)
    public static long combination(long n, long r, long m, long[] fact, long[] ifact) {
        long val1 = fact[(int)n];
        long val2 = ifact[(int)(n - r)];
        long val3 = ifact[(int)r];
        return (((val1 * val2) % m) * val3) % m;
    }

    //-----------PrintWriter for faster output---------------------------------
    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;
        }

    }
   //--------------------------------------------------------
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	static AReader scan = new AReader();
	static char[] cs;
	static int res = 0;
	static int X = 0;
	static int n;

	static void dfs(int u,int s){
		if(u >= n){
			if(s % 25 == 0) res++;
			return;
		}
		int t = cs[u] - '0';
		if(t>=0 && t <= 9) dfs(u+1,s*10+t);
		else if(cs[u] == 'X') dfs(u+1,s*10+X);
		else {
			if (u == n - 1) {
				dfs(u + 1, s * 10 + 5);
				dfs(u + 1, s * 10);
			} else {
				for (int i = 0; i < 10; i++) {
					if (i == 0 && u == 0) continue;
					dfs(u + 1, s * 10 + i);
				}
			}
		}
	}

	static void solve() {
		cs = scan.next().toCharArray();
		n = cs.length;
		boolean flag = false;
		for(char c:cs){
			if(c == 'X'){
				flag = true;
				break;
			}
		}
		if(cs[0] == '0' && n != 1){
			System.out.println(0);
			return;
		}
		if(flag){
		for(int i = 0;i<10;i++) {
			X = i;
			dfs(0,0);
		}
		}else dfs(0,0);
		System.out.println(res);
	}

	public static void main(String[] args)  {
		//int T = scan.nextInt();
		//while (T-- > 0) {
		solve();
		//}
		//System.out.print(sb.toString());
	}
}

class AReader {
	private BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	private StringTokenizer tokenizer = new StringTokenizer("");

	private String innerNextLine() {
		try {
			return reader.readLine();
		} catch (IOException ex) {
			return null;
		}
	}

	public boolean hasNext() {
		while (!tokenizer.hasMoreTokens()) {
			String nextLine = innerNextLine();
			if (nextLine == null) {
				return false;
			}
			tokenizer = new StringTokenizer(nextLine);
		}
		return true;
	}

	public String nextLine() {
		tokenizer = new StringTokenizer("");
		return innerNextLine();
	}

	public String next() {
		hasNext();
		return tokenizer.nextToken();
	}

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

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

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

class Pair {
	int x,y;

	public Pair(int x, int y) {
		this.x = x;
		this.y = y;
	}
}


import java.io.*;
import java.util.*;
// Problem Link: https://codeforces.com/problemset/problem/1575/D
public class div25 {
    public static char[] str;
    public static int S;
    public static void main (String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        str = in.readLine().toCharArray();
        S = str.length;
        int ans = 0;
        if (S==1) {
            if (str[0]=='X' || str[0] == '_' || Integer.parseInt(String.valueOf(str[0])) == 0) ans = 1;
        }
        else {
            ans += count_possibilities(2, 5);
            ans += count_possibilities(5, 0);
            ans += count_possibilities(7, 5);
            ans += count_possibilities(0, 0); }
        System.out.println(ans);

    }
    static int count_possibilities(int end1, int end2) {
        //System.out.println(end1 + " " + end2);
        int X_val = -1;
        if (str[S-2]=='X') X_val = end1;
        else {
            if (str[S-2]!='_') {
                if (value(S-2) != end1) return 0; } }
        //System.out.println("reached here");
        if (str[S-1]=='X') {
            if (X_val != -1 && end2 != X_val) return 0;
            else X_val = end2; }
        else {
            if (str[S-1]!='_') {
                if (value(S-1) != end2) return 0; } }
        //System.out.println("reached HERE");
        int total = 1;
        for (int i=0;i<S-2;i++) {
//            System.out.println(total);
//            System.out.println(X_val);
//            System.out.println(i + " " + str[i]);
            if (i==0) {
                if (str[i]=='X' && X_val==0) return 0;
                if (value(0) == 0) return 0; }
            if (str[i]=='_') {
                if (i==0) total *= 9;
                else total *= 10; }
            if (str[i]=='X') {
                if (X_val != -1) continue;
                else {
                    X_val = 10; // represents that X can be any integer from 0 to 9 (or possibly 1 to 9)
                    if (i==0) total *= 9;
                    else total *= 10;
                }
            }
        }
        //System.out.println(total);
        return total;
    }

    static boolean isDigit(int pos) {
        if (str[pos]=='_' || str[pos]=='X') return false;
        else return true;
    }

    static int value(int pos) {
        if (!isDigit(pos)) return -1;
        return Integer.parseInt(String.valueOf(str[pos]));
    }
}


import java.io.*;
import java.util.*;

public class P1575D {
    public static void main(String[] args) throws IOException {
        MyScanner scanner = new MyScanner(System.in);
        PrintWriter writer = new PrintWriter(System.out);

        char[] s = scanner.nextToken().toCharArray();
        int ans = 0;

        if (s.length == 1) {
            if (s[0] == '0' || s[0] == '_' || s[0] == 'X') {
                ans = 1;
            }
        } else {
            int n = s.length;
            if (!(s[n - 1] == 'X' && s[n - 2] == 'X')) {
                // put 25
                if (canPut(s, n - 1, '5') && canPut(s, n - 2, '2')) {
                    char[] s1 = Arrays.copyOf(s, n);
                    put(s1, n - 1, '5');
                    put(s1, n - 2, '2');
                    ans += possible(s1);
                }
                // put 50
                if (canPut(s, n - 1, '0') && canPut(s, n - 2, '5')) {
                    char[] s1 = Arrays.copyOf(s, n);
                    put(s1, n - 1, '0');
                    put(s1, n - 2, '5');
                    ans += possible(s1);
                }
                // put 75
                if (canPut(s, n - 1, '5') && canPut(s, n - 2, '7')) {
                    char[] s1 = Arrays.copyOf(s, n);
                    put(s1, n - 1, '5');
                    put(s1, n - 2, '7');
                    ans += possible(s1);
                }
            }
            // put 00
            if (s[n - 1] == 'X' && s[n - 2] == 'X') {
                char[] s1 = Arrays.copyOf(s, n);
                put(s1, n - 1, '0');
                ans += possible(s1);
            } else if (canPut(s, n - 1, '0') && canPut(s, n - 2, '0')) {
                char[] s1 = Arrays.copyOf(s, n);
                put(s1, n - 1, '0');
                put(s1, n - 2, '0');
                ans += possible(s1);
            }
        }
        writer.println(ans);

        writer.flush();
    }

    private static boolean canPut(char[] s, int p, char d) {
        if (s[p] == 'X' || s[p] == '_') {
            return true;
        }
        return s[p] == d;
    }

    private static void put(char[] s, int p, char d) {
        if (s[p] == 'X') {
            replace(s, d);
        } else {
            s[p] = d;
        }
    }

    private static void replace(char[] s, char d) {
        for (int i = 0; i < s.length; i++) {
            if (s[i] == 'X') {
                s[i] = d;
            }
        }
    }

    private static int possible(char[] s) {
        int p = 1;

        if (s[0] == '0') {
            return 0;
        }
        if (s[0] == '_') {
            p *= 9;
        }
        for (int i = 1; i < s.length; i++) {
            if (s[i] == '_') {
                p *= 10;
            }
        }

        return p;
    }

    private static class MyScanner {
        private BufferedReader reader;
        private StringTokenizer st;

        public MyScanner(InputStream inputStream) {
            reader = new BufferedReader(new InputStreamReader(inputStream));
        }

        private String nextToken() throws IOException {
            while(st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(reader.readLine());
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(nextToken());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(nextToken());
        }
    }
}


import java.io.*;
public class Coloring
{
    public static void main(String...args)
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        String[] st = s.trim().split("\\s+");
        int n = Integer.parseInt(st[0]);
        int m = Integer.parseInt(st[1]);

        if(n < m)
            swap(n , m);

        long mod = 998244353;

        long res[][] = new long[n+m][n];

        for(int i = 0 ; i < n+m ; i++){
            for(int j = 0 ; j < n ; j++){
                if(j == 0)
                    res[i][j] = 1;
                else if(i == 0)
                    res[i][j] = 0;
                else
                    res[i][j] = res[i-1][j-1] + res[i-1][j];
            }
        }

        long ans2 = 0;

        for(int rows = 1 ; rows < n ; rows++){
            long ans1 = 0;
            for(int col = m-1 ; col >=0 ; col--){
                ans1 = (ans1 + res[n - rows + m - col -1][n - rows]*(res[n - rows + col - 1][n - rows - 1])) % mod;
                ans2 = (ans2 + res[rows + col -1][rows] * ((res[rows + m - col - 1][rows - 1] * ans1) % mod)) % mod;
            }
        }

        swap(n , m);
        for(int rows = 1 ; rows < n ; rows++){
            long ans1 = 0;
            for(int col = m-1 ; col >=0 ; col--){
                ans2 = (ans2 + res[rows + col -1][rows] * ((res[rows + m - col - 1][rows - 1] * ans1) % mod)) % mod;
                ans1 = (ans1 + res[n - rows + m - col -1][n - rows]*(res[n - rows + col - 1][n - rows - 1])) % mod;
            }
        }

        ans2 = (ans2 * 2) % mod;
        System.out.println(ans2);

    }

    public static void swap(int x , int y){
       int temp;
       temp = x;
       x = y;
       y = temp;
    }
}


import java.io.*;
public class Coloring
{
    public static void main(String...args)throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        String[] st = s.trim().split("\\s+");
        int n = Integer.parseInt(st[0]);
        int m = Integer.parseInt(st[1]);

        if(n < m)
            swap(n , m);

        long mod = 998244353;

        long res[][] = new long[n+m][n];

        for(int i = 0 ; i < n+m ; i++){
            for(int j = 0 ; j < n ; j++){
                if(j == 0)
                    res[i][j] = 1;
                else if(i == 0)
                    res[i][j] = 0;
                else
                    res[i][j] = (res[i-1][j-1] + res[i-1][j]) % mod;
            }
        }

        long ans2 = 0;

        for(int rows = 1 ; rows < n ; rows++){
            long ans1 = 0;
            for(int col = m-1 ; col >= 1 ; col--){
                ans1 = (ans1 + res[n - rows + m - col -1][n - rows]*(res[n - rows + col - 1][n - rows - 1])) % mod;
                ans2 = (ans2 + res[rows + col -1][rows] * ((res[rows + m - col - 1][rows - 1] * ans1) % mod)) % mod;
            }
        }

        swap(n , m);
        for(int rows = 1 ; rows < n ; rows++){
            long ans1 = 0;
            for(int col = m-1 ; col >= 1 ; col--){
                ans2 = (ans2 + res[rows + col -1][rows] * ((res[rows + m - col - 1][rows - 1] * ans1) % mod)) % mod;
                ans1 = (ans1 + res[n - rows + m - col -1][n - rows]*(res[n - rows + col - 1][n - rows - 1])) % mod;
            }
        }

        ans2 = (ans2 * 2) % mod;
        System.out.println(ans2);

    }

    public static void swap(int x , int y){
       int temp;
       temp = x;
       x = y;
       y = temp;
    }
}


import java.io.*;
public class Coloring
{
    public static void main(String...args)throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        String[] st = s.trim().split("\\s+");
        int n = Integer.parseInt(st[0]);
        int m = Integer.parseInt(st[1]);

        if(n < m)
            swap(n , m);

        long mod = 998244353;

        long res[][] = new long[n+m][n];

        for(int i = 0 ; i < n+m ; i++){
            for(int j = 0 ; j < n ; j++){
                if(j == 0)
                    res[i][j] = 1;
                else if(i == 0)
                    res[i][j] = 0;
                else
                    res[i][j] = (res[i-1][j-1] + res[i-1][j]) % mod;
            }
        }

        long ans2 = 0;

        for(int rows = 1 ; rows < n ; rows++){
            long ans1 = 0;
            for(int col = m-1 ; col >= 1 ; col--){
                ans1 = (ans1 + res[n - rows + m - col -1][n - rows]*(res[n - rows + col - 1][n - rows - 1])) % mod;
                ans2 = (ans2 + res[rows + col -1][rows] * ((res[rows + m - col - 1][rows - 1] * ans1) % mod)) % mod;
            }
        }

        n= swap(m , m = n);
        //System.out.println(n+" "+m);
        for(int rows = 1 ; rows < n ; rows++){
            long ans1 = 0;
            for(int col = m-1 ; col >= 1 ; col--){
                ans2 = (ans2 + res[rows + col -1][rows] * ((res[rows + m - col - 1][rows - 1] * ans1) % mod)) % mod;
                ans1 = (ans1 + res[n - rows + m - col -1][n - rows]*(res[n - rows + col - 1][n - rows - 1])) % mod;
            }
        }

        ans2 = (ans2 * 2) % mod;
        System.out.println(ans2);

    }

    public static int swap(int...args){
        return args[0];
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
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
 */
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);
        FNezzarAndChocolateBars solver = new FNezzarAndChocolateBars();
        solver.solve(1, in, out);
        out.close();
    }

    static class FNezzarAndChocolateBars {
        static final int MAXN = 2048;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            MOD2 mod = new MOD2();
            int[] fact = new int[MAXN];
            int[] ifact = new int[MAXN];
            fact[0] = ifact[0] = 1;
            for (int i = 1; i < MAXN; i++) {
                fact[i] = mod.multiply(fact[i - 1], i);
                ifact[i] = mod.inverse(fact[i]);
            }
            int n = in.nextInt(), k = in.nextInt();
            int[] l = in.readIntArray(n);
            int[][][] dp = new int[2][MAXN / k][MAXN / k];
            dp[1][0][0] = 1;
            int s = 0;

            for (int p = 0; p < n; p++) {
                int L = l[p];
                int invL = mod.inverse(L);
                int[] coeffs = new int[L / k + 1];
                int[] coeffs2 = new int[L / k + 1];
                for (int i = 0; i <= L / k; i++) {
                    if (k * i == L) continue;
                    int z = ifact[i];
                    if (i % 2 == 1) z = mod.subtract(0, z);
                    coeffs[i] = mod.multiply(z, mod.power(L - k * i, i));

                    if (i >= 1) {
                        coeffs2[i] = mod.multiply(z, mod.multiply(i, mod.power(L - k * i, i - 1)));
                    }
                }
                int r = p & 1;
                int h = r ^ 1;
                for (int i = 0; i <= s / k; i++) Arrays.fill(dp[r][i], 0);
                for (int i = 0; i <= s / k; i++)
                    for (int j = 0; j <= s / k; j++)
                        if (dp[h][i][j] != 0) {
                            int value = dp[h][i][j];
                            for (int t = 0; t <= L / k; t++) {
                                dp[r][i + t][j + t] = mod.add(dp[r][i + t][j + t], mod.multiply(value, coeffs[t]));
                                if (t > 0) {
                                    dp[r][i + t - 1][j + t] = mod.add(dp[r][i + t - 1][j + t], mod.multiply(value, coeffs2[t]));
                                }
                            }
                        }
                s += L;
            }
            int answer = 0;
            for (int i = 0; i <= s / k; i++)
                for (int j = 1; j <= s / k; j++) {
                    int value = dp[(n - 1) & 1][i][j];
                    int temp = mod.multiply(fact[i], mod.inverse(mod.power(k * j, i + 1)));
                    answer = mod.add(answer, mod.multiply(value, temp));
                }
            out.println(mod.multiply(mod.subtract(0, s), answer));
        }

    }

    static class MOD2 {
        static final int modulo = 998244353;

        public int add(int x, int y) {
            x += y;
            if (x >= modulo) x -= modulo;
            return x;
        }

        public int subtract(int x, int y) {
            x -= y;
            if (x < 0) x += modulo;
            return x;
        }

        public int multiply(int x, int y) {
            return (int) ((x * 1L * y) % modulo);
        }

        public int power(int x, long y) {
            int ans = 1;
            for (; y > 0; y >>= 1, x = (int) ((x * 1L * x) % modulo))
                if (y % 2 == 1) ans = (int) ((ans * 1L * x) % modulo);
            return ans;
        }

        public int inverse(int x) {
            return power(x, modulo - 2);
        }

    }

    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[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        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 nextInt() {
            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 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 println(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
            writer.print('\n');
        }

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

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
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
 */
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);
        FNezzarAndChocolateBars solver = new FNezzarAndChocolateBars();
        solver.solve(1, in, out);
        out.close();
    }

    static class FNezzarAndChocolateBars {
        static final int MAXN = 2048;
        static final int modulo = 998244353;

        public int add(int x, int y) {
            x += y;
            if (x >= modulo) x -= modulo;
            return x;
        }

        public int subtract(int x, int y) {
            x -= y;
            if (x < 0) x += modulo;
            return x;
        }

        public int multiply(int x, int y) {
            return (int) ((x * 1L * y) % modulo);
        }

        public int power(int x, long y) {
            int ans = 1;
            for (; y > 0; y >>= 1, x = (int) ((x * 1L * x) % modulo))
                if (y % 2 == 1) ans = (int) ((ans * 1L * x) % modulo);
            return ans;
        }

        public int inverse(int x) {
            return power(x, modulo - 2);
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int[] fact = new int[MAXN];
            int[] ifact = new int[MAXN];
            fact[0] = ifact[0] = 1;
            for (int i = 1; i < MAXN; i++) {
                fact[i] = multiply(fact[i - 1], i);
                ifact[i] = inverse(fact[i]);
            }
            int n = in.nextInt(), k = in.nextInt();
            int[] l = in.readIntArray(n);
            int[][][] dp = new int[2][MAXN / k][n + 1];
            dp[1][0][0] = 1;
            int s = 0;

            for (int p = 0; p < n; p++) {
                int L = l[p];
                int invL = inverse(L);
                int[] coeffs = new int[L / k + 1];
                int[] coeffs2 = new int[L / k + 1];
                for (int i = 0; i <= L / k; i++) {
                    if (k * i == L) continue;
                    int z = ifact[i];
                    if (i % 2 == 1) z = subtract(0, z);
                    coeffs[i] = multiply(z, power(L - k * i, i));

                    if (i >= 1) {
                        coeffs2[i] = multiply(z, multiply(i, power(L - k * i, i - 1)));
                    }
                }
                int r = p & 1;
                int h = r ^ 1;
                for (int i = 0; i <= s / k; i++) Arrays.fill(dp[r][i], 0);
                for (int i = 0; i <= s / k; i++)
                    for (int j = 0; j <= p; j++)
                        if (dp[h][i][j] != 0) {
                            int value = dp[h][i][j];
                            for (int t = 0; t <= L / k; t++) {
                                dp[r][i + t][j] = add(dp[r][i + t][j], multiply(value, coeffs[t]));
                                if (t > 0) {
                                    dp[r][i + t - 1][j + 1] = add(dp[r][i + t - 1][j + 1], multiply(value, coeffs2[t]));
                                }
                            }
                        }
                s += L;
            }
            int answer = 0;
            for (int i = 0; i <= s / k; i++)
                for (int r = 0; r <= n; r++) {
                    int value = dp[(n - 1) & 1][i][r];
                    int j = i + r;
                    if (j == 0) continue;
                    int temp = multiply(fact[i], inverse(power(k * j, i + 1)));
                    answer = add(answer, multiply(value, temp));
                }
            out.println(multiply(subtract(0, s), answer));
        }

    }

    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[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        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 nextInt() {
            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 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 println(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
            writer.print('\n');
        }

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

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main{
	public static void main(String[] args) {
		try(InputStream inputStream = System.in;){
			InputReader in = new InputReader(inputStream);

			int T = in.nextInt();
			while(T-- > 0){
				int n = in.nextInt();
				if(n > 19) System.out.println("NO");
				else{
					System.out.println("YES");
					for(int i = 1; i < Math.pow(10, 9); i*=3){
						System.out.print(i+" ");
					}
					System.out.println();
				}

			}
		}catch(Exception e){
			e.printStackTrace();
		}
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next(){
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
				    tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
				    throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
	}
}


import java.util.*;
public class Main
{
	public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
	    int t = s.nextInt();
	    while(t > 0){
	        System.out.println(PlayOff(s.nextInt()));
	        t--;
	    }

	}

	public static double PlayOff(int n){
	    double dou = Math.pow(2, n);
	    long l = (long)dou;
	    int in = (int)dou;
	    return dou-1;
	}
}


/*#####################################################
################ >>>> Diaa12360 <<<< ##################
################     Just Nothing    ##################
############ If You Need it, Fight For IT; ############
####################.-. 1 5 9 2 .-.####################
######################################################*/
import javax.swing.plaf.IconUIResource;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        StringBuilder out = new StringBuilder();
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tk;
        int t = Int(in.readLine());
        while(t-- > 0){
            out.append(Math.pow(2, Int(in.readLine()) - 1)).append('\n');
        }
        System.out.print(out);
    }

    static int Int(String s) {return Integer.parseInt(s);}
    static long Lon(String s) {return Long.parseLong(s);}
}
/*

 */


import java.util.*;

public class Code {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            System.out.println(Math.pow(2,n)-1);
        }
    }
}


import java.io.*;
import java.util.*;
public class playoff {

	public static void main(String[] args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int T = Integer.parseInt(br.readLine());
		while(T-- > 0) {
			int N = Integer.parseInt(br.readLine());
			System.out.println(Math.pow(2, N) - 1);
		}

	}

}


import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int  n = sc.nextInt();
        BigInteger t = BigInteger.valueOf(2);
        BigInteger x = t.pow(n);
        System.out.println(x.subtract(BigInteger.valueOf(1)));
    }
}


import java.util.*;

public class L3 {
    public static void main(String[] args) throws Exception{
        Scanner br = new Scanner(System.in);
        int totalInputs = br.nextInt();
       while(totalInputs-->0){
            int n = Integer.parseInt(br.next());
            double  max= Math.pow(2, n);
            System.out.println(max-1);
        }
        br.close();

    }

}


import java.util.Scanner;

public class PLayoff {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0)
        {
            int n=sc.nextInt();
            System.out.println(Math.pow(2,n)-1);
        }
    }
}


import java.lang.*;
import java.io.*;
import java.util.*;
public class My
{
    public static void main(String[] args)
    {
        Scanner scn=new Scanner(System.in);
        int t=scn.nextInt();
        while(t-->0)
        {
            int n=scn.nextInt();
            int pow=(int)Math.pow(2,n);
            if(n%2==1)
            {
                System.out.println(pow-1);
            }
            else{
                System.out.println(pow);
            }
        }
    }
}


import java.io.*;
import java.util.*;
public class Playoff {
	public static PrintWriter out;
	public static void main(String[] args)throws IOException{
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st=new StringTokenizer(br.readLine());
        Scanner sc=new Scanner();
        out=new PrintWriter(System.out);
        int t=sc.nextInt();
        while(t-->0) {
        	int n=sc.nextInt();
        	long ans=(long) Math.pow(2, n);
        	out.println(ans-1);
        }
	}
	public static class Scanner {
	    BufferedReader br;
	    StringTokenizer st;

	    public Scanner() {
	        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;
	    }
	}
}


import java.util.*;
import java.lang.Math;

public class Main {

	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int t= sc.nextInt();
		while(t-->0){
			int x=sc.nextInt();
			System.out.println((Math.pow(2, x)-1));
		}

	}

}


import java.util.Scanner;

/**
 * Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools
 *
 * To modify the template, go to Preferences -> Editor -> File and Code Templates -> Other
 */

public class Main {
   public static long Lpow(long a, long b) {
      long ans = 1;
      while(b > 0) {
         if(b%2 == 1)
            ans = ans * a;
         a = a * 2;
         b /= 2;
      }
      return ans;
   }

   public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      long t = scanner.nextInt();
      while(t > 0) {
         long n = scanner.nextLong();
         System.out.println(Lpow(2,n) - 1);
         t--;
      }
   }
}


import java.io.*;

import java.util.*;

public class Main
{

  public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int num = (int)Math.pow(2,n);

        System.out.println(num-1);

  }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            if ( n == 1) out.println(1);
            for (int i = 0; i < n; ++i) {
                out.println(in.nextInt() - 1);
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

    }
}


import java.util.*;

public class Main{
    public static void main( String[] args){
     Scanner sc = new Scanner( System.in);
     int t= sc.nextInt();
     while(t-->0){
         int n = sc.nextInt();
         System.out.println( Math.pow(2,n)-1);
     }
    }

}


import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int t=s.nextInt();
        int n=s.nextInt();
        while (t-->0){
            int ans= (int) (Math.pow(2,n)-1);
            System.out.println(ans);
        }
    }
}


import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) throws Exception {
int t = sc.nextInt();
while(t-->0) {
	int n = sc.nextInt();
	pw.println(Math.pow(2, n)-1);
}

	pw.flush();
	}

	static class SegmentTree {
		int[] arr, sTree, lazy;
		int N;

		public SegmentTree(int[] in) {
			arr = in;
			N = in.length - 1;
			sTree = new int[2 * N];
			lazy = new int[2 * N];
			build(1, 1, N);
		}

		public void build(int Node, int left, int right) { // O(n)
			if (left == right)
				sTree[Node] = arr[left];
			else {
				int r = 2 * Node + 1;
				int l = 2 * Node;
				int mid = (left + right) / 2;
				build(l, left, mid);
				build(r, mid + 1, right);
				sTree[Node] = sTree[l] + sTree[r];
			}

		}

		public int query(int i, int j) {
			return query(1, 1, N, i, j);
		}

		public int query(int Node, int left, int right, int i, int j) {
			if (right < i || left > j)
				return 0;
			if (right <= j && i <= left) {
				return sTree[Node];
			}
			int mid = (left + right) / 2;
			int l = 2 * Node;
			int r = 2 * Node + 1;
			return query(l, left, mid, i, j) + query(r, mid + 1, right, i, j);
		}

		public void updatePoint(int idx, int value) {
			int node = idx + N - 1;
			arr[idx] = value;
			sTree[node] = value;
			while (node > 1) {
				node /= 2;
				int l = 2 * node;
				int r = 2 * node + 1;
				sTree[node] = sTree[l] + sTree[r];
			}
		}

		public void updateRange(int i, int j, int val) {
			updateRange(1, 1, N, i, j, val);
		}

		public void updateRange(int Node, int left, int right, int i, int j, int val) {
			if (i > right || left > j)
				return;
			if (right <= j && i <= left) {
				sTree[Node] += val * (right - left + 1);
				lazy[Node] += val;
			} else {
				int l = 2 * Node;
				int r = 2 * Node + 1;
				int mid = (left + right) / 2;
				propagate(Node, left, right);
				updateRange(l, left, mid, i, j, val);
				updateRange(r, mid + 1, right, mid, j, val);
				sTree[Node] = sTree[l] + sTree[r];
			}
		}

		public void propagate(int node, int left, int right) {
			int l = 2 * node;
			int r = 2 * node + 1;
			int mid = (left + right) / 2;
			lazy[l] = lazy[node];
			lazy[r] = lazy[node];
			sTree[l] += lazy[node] * (mid - left + 1);
			sTree[r] += lazy[node] * (right - mid);
			lazy[node] = 0;
		}
	}

	public static void sort(int[] in) {
		shuffle(in);
		Arrays.sort(in);
	}

	public static void shuffle(int[] in) {
		for (int i = 0; i < in.length; i++) {
			int idx = (int) (Math.random() * in.length);
			int tmp = in[i];
			in[i] = in[idx];
			in[idx] = tmp;
		}
	}

	static class Pair implements Comparable<Pair> {
		int x;
		int y;

		public Pair(int x, int y) {
			this.x = x;
			this.y = y;
		}

		public int compareTo(Pair o) {
			return x - o.x;
		}

		public String toString() {

			return x + " " + y;
		}

	}

	static Scanner sc = new Scanner(System.in);
	static PrintWriter pw = new PrintWriter(System.out);

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader r) {
			br = new BufferedReader(r);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public long[] nextlongArray(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public Long[] nextLongArray(int n) throws IOException {
			Long[] a = new Long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public Integer[] nextIntegerArray(int n) throws IOException {
			Integer[] a = new Integer[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}

	public static void display(char[][] a) {
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.print(a[i][j]);
			}
			System.out.println();

		}
	}

}


import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        for (int i = 0; i < t; i++) {
            long n = sc.nextInt();
            System.out.println(Math.pow(2, n) - 1);
        }
    }
}


import java.util.*;
public class A{
  static Scanner sc;
  public static void solve(){

  }
  public static void main(String args[]){
      sc = new Scanner(System.in);
      int t = sc.nextInt();
      while(t-->0) solve();
  }
}


//package test;

import java.awt.*;
import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Main implements Runnable {
    int size[];
    static int e9 = 1000000007;
    int max = Integer.MIN_VALUE;
    long max1 = Long.MIN_VALUE;
    long min1 = Long.MAX_VALUE;
    long fib[][];
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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;
        }
    }
    int parent[];
    int rank[];
    ArrayList<ArrayList<Integer>> arrayLists;
    long fib1[][];
    long r[];
    int n;
    int m;
    long co=0;
    long v[];
    int arr[][];
    int u=0;
    HashMap<Long,Long> hashMap=new HashMap<>();
    ArrayList<Long> arrayList;
    long ans=0;
    public static void main(String[] args) throws IOException {
        new Thread(null,new Main(),"Main",1<<28).start();
    }

    public void run() {
        FastReader scanner = new FastReader();
//            Scanner scanner = new Scanner(System.in);
//            BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter printWriter = new PrintWriter(System.out);
        long t =scanner.nextLong();
        high:while (t-- > 0) {
           int n=scanner.nextInt();
           if(n==2){
               printWriter.println(1);
           }
           else{
               printWriter.println(fastPow(2,n)-1);
           }
        }
        printWriter.flush();
    }
    static long mod=1_000_000_007;
    public boolean check(long i,long arr[]){
//        System.out.println(i);
        Set<Long> set=new HashSet<>();
        for (int j = 0; j < arr.length; j++) {
            long o=arr[j]%i;
            set.add(o);
//            System.out.println(o);
        }
        if(set.size() == arr.length) {
            for(long j = 1; j <= arr.length; j++) {
                if(!set.contains(j)) {
                    return false;
                }
            }
        }
        else{
            return false;
        }
        return true;
    }
    public int find(int s,int e){
        FastReader scanner=new FastReader();
        PrintWriter printWriter=new PrintWriter(System.out);
        printWriter.print("? "+(e-s+1)+" ");
        for (int i = s; i <=e; i++) {
            printWriter.print(i+" ");
        }
        printWriter.flush();
        int u=scanner.nextInt();
        return u;
    }
    public long lcm(long a,long b){
        return (a*b)/gcd(a,b);
    }
    public long mul(long a, long b) {
//        System.out.println(a+" "+b);
        return ((a)*(b));
    }
    public long fact(int x) {
        long ans=1;
        for (int i=2; i<=x; i++) ans=mul(ans, i);
        return ans;
    }
    public long fastPow(long base, long exp) {
        if (exp==0) return 1;
        long half=fastPow(base, exp/2);
        if (exp%2==0) return mul(half, half);
        return mul(half, mul(half, base));
    }
    public long modInv(long x) {
        return fastPow(x, mod-2);
    }
    public long nc2(long n,long k){
        return n*(n-1)/2;
    }
    public long nCk(int n, int k) {
        return fact(n)/mul(fact(k),fact(n-k));
//        return mul(fact(n), mul(modInv(fact(k)), modInv(fact(n-k))));

    }
    public void parent(int n){
        parent=new int[n+1];
        size=new int[n+1];
        rank=new int[n+1];
        for (int i = 0; i <=n; i++) {
            parent[i]=i;
            rank[i]=0;
//            size[i]=1;
        }
    }
    public void union(int i,int j){
        int root1=find(i);
        int root2=find(j);
//            if(root1 != root2) {
//                parent[root2] = root1;
////                sz[a] += sz[b];
//            }
        if(root1==root2){
            return;
        }
        if(rank[root1]>rank[root2]){
            parent[root2]=root1;
            size[root1]+=size[root2];
        }
        else if(rank[root1]<rank[root2]){
            parent[root1]=root2;
            size[root2]+=size[root1];
        }
        else{
            parent[root2]=root1;
            rank[root1]+=1;
            size[root1]+=size[root2];
        }
    }
    public int find(int p){
        if(parent[p]!=p){
            if(parent[p]==-1){
                return parent[p];
            }
            parent[p]=find(parent[p]);
        }
        return parent[p];
    }
    public double dist(double x1,double y1,double x2,double y2){
        double e=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);
        double e1=Math.sqrt(e);
        return e1;
    }
    public void make(int p){
        parent[p]=p;
        rank[p]=1;
    }
    Random rand = new Random();
    public void sort(int[] a, int n) {
        for (int i = 0; i < n; i++) {
            int j = rand.nextInt(i + 1);
            int tmp = a[i];
            a[i] = a[j];
            a[j] = tmp;
        }
        Arrays.sort(a, 0, n);
    }
    public long gcd(long a,long b){
        if(b==0){
            return a;
        }
        return gcd(b,a%b);
    }
    public double fact(double h){
        double sum=1;
        while(h>=1){
            sum=(sum%e9)*(h%e9);
            h--;
        }
        return sum%e9;
    }
    public long primef(double r){
        long c=0;
        long ans=1;
        long g=0;
        while(r%2==0){
            c++;
            r=r/2;
        }
        if(c>0){
            ans*=2;
        }
        c=0;
//            System.out.println(ans+" "+r);
        for (int i = 3; i <=Math.sqrt(r) ;i+=2) {
            g=0;
            while(r%i==0){
//                    System.out.println(i);
                c++;
                g++;
                r=r/i;
            }
            if(c>0){
                ans*=i;
            }
            c=0;
        }
        if(r>2){
            ans*=r;
        }
        return ans;
    }
    public long divisor(double r){
        long c=0;
//        if(n==3)
//            System.out.println(r+" "+n+" "+k+" "+"l");
        for (int i =2; i <=Math.sqrt(r); i++) {
            if(r%i==0){
                if(r/i==i){
                    c++;
                }
                else{
                    if(r/i<n){
                        c+=2;
                    }else{
                        c++;
                    }
                }
            }
        }
        return c;
    }
}
class Pair {
    long z;
    long x;
    long y;
    public Pair(long x,long y,long z) {
        this.x=x;
        this.y = y;
        this.z = z;
//        this.z=z;
    }

//     @Override
//    public int hashCode() {
//        int hash = 37;
//        return this.x * hash + this.y;
//    }
//
//    @Override
//    public boolean equals(Object o1) {
//        if (o1 == null || o1.getClass() != this.getClass()) {
//            return false;
//        }
//        Pair o = (Pair) o1;
//        if (o.x == this.x && o.y == this.y) {
//            return true;
//        }
//        return false;
//    }
}
class Pair1{
    long x;
    long y;
    long z;
    public Pair1(long x,long y) {
        this.x=x;
        this.y = y;
//        this.y = y;
//        this.z=z;
    }
}
//class Sorting implements Comparator<Pair> {
//    public int compare(Pair p1, Pair p2) {
//        if(p1.x==p2.x){
//            return Long.compare(p1.y,p2.y);
//        }else {
//            return Long.compare(p1.x, p2.x);
//        }
//    }
//}
class Edge{
    int s=0;
    int d=0;
    int c=0;
    public Edge(int s,int d,int c){
        this.s=s;
        this.d=d;
        this.c=c;
    }
}


import java.util.*;
import java.io.*;
import java.lang.*;
public class Main {
    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;
        }
        int[] readArray(int n) {
            int[] ar = new int[n];
            for (int i = 0; i < n; i++)
                ar[i] = nextInt();
            return ar;
        }
        long[] readArray2(int n) {
            long[] ar = new long[n];
            for (int i = 0; i < n; i++)
                ar[i] = nextLong();
            return ar;
        }
    }
    static class DSU {
        int[] parent;
        int[] rank;
        int[] sz;

        public DSU(int N) {
            parent = new int[N];
            for (int i = 0; i < N; ++i)
                parent[i] = i;
            rank = new int[N];
            sz = new int[N];
            Arrays.fill(sz, 1);
        }

        public int find(int x) {
            if (parent[x] != x) parent[x] = find(parent[x]);
            return parent[x];
        }

        public void union(int x, int y) {
            int xr = find(x), yr = find(y);
            if (xr == yr) return;

            if (rank[xr] < rank[yr]) {
                int tmp = yr;
                yr = xr;
                xr = tmp;
            }
            if (rank[xr] == rank[yr])
                rank[xr]++;

            parent[yr] = xr;
            sz[xr] += sz[yr];
        }

        public int size(int x) {
            return sz[find(x)];
        }

        public int top() {
            return size(sz.length - 1) - 1;
        }
    }
    static class Pair{
        int min;
        int max;
        public Pair(){
            min=Integer.MAX_VALUE;
            max=Integer.MIN_VALUE;
        }
        public void updateMax(int a){
            max=Math.max(a,max);
        }
        public void updateMin(int a){
            min=Math.min(a,min);
        }
        public int getMin(){
            return min;
        }
        public int getMax(){
            return min;
        }
    }
    private static MyScanner sc;
    public static void main(String[] args) {
        sc=new MyScanner();
        int T=sc.nextInt();
        for(int i=0;i<T;i++){
            solve(i);
        }
    }
    private static void solve(int t) {
        int n=sc.nextInt();
        System.out.println(Math.pow(2,n)-1);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class CF1{
    public static void main(String[] args) {
        FastScanner sc=new FastScanner();
        int T=sc.nextInt();
//        int T=1;
        for (int tt=0; tt<T; tt++){
            int n = sc.nextInt();
            n=(int)power2(2,n);
            System.out.println(n-1);
        }
    }
    static long factorial (int x){
        if (x==0) return 1;
        long ans =x;
        for (int i=x-1; i>=1; i--){
            ans*=i;
            ans%=mod;
        }
        return ans;
    }
    static int mod =1000000007;
    static long power2 (long a, long b){
        long res=1;
        while (b>0){
            if ((b&1)== 1){
                res= (res * a % mod)%mod;
            }
            a=(a%mod * a%mod)%mod;
            b=b>>1;
        }
        return res;
    }

    boolean[] sieveOfEratosthenes(int n)
    {

        boolean prime[] = new boolean[n+1];
        for(int i=0;i<=n;i++)
            prime[i] = true;

        for(int p = 2; p*p <=n; p++)
        {
            if(prime[p] == true)
            {
                for(int i = p*p; i <= n; i += p)
                    prime[i] = false;
            }
        }
        return prime;
    }
    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }
    static void sortLong(long[] a) {
        ArrayList<Long> l=new ArrayList<>();
        for (long i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }
    static long gcd (long n, long m){
        if (m==0) return n;
        else return gcd(m, n%m);
    }

    static class Pair implements Comparable<Pair>{
        int x,y;
        public Pair(int x, int y){
            this.x = x;
            this.y = y;
        }
        public int compareTo(Pair o){
            return this.x-o.x;
        }
        // this.x-o.x is ascending
    }
    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Random;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.function.Function;

public class Solution {
    // VM options: -Xmx1024m -Xss1024m

    private void solve() throws IOException {
        println((1<<nextInt())-1);
    }

    private static final String inputFilename = "input.txt";
    private static final String outputFilename = "output.txt";
    private BufferedReader in;
    private StringTokenizer line;
    private PrintWriter out;
    private final boolean isDebug;

    private Solution(boolean isDebug) {
        this.isDebug = isDebug;
    }

    public static void main(String[] args) throws IOException {
        new Solution(Arrays.asList(args).contains("DEBUG_MODE")).run(args);
    }

    private void run(String[] args) throws IOException {
        if (isDebug) {
            in = new BufferedReader(new InputStreamReader(new FileInputStream(inputFilename)));
//            in = new BufferedReader(new InputStreamReader(System.in));
        } else {
            in = new BufferedReader(new InputStreamReader(System.in));
        }
        out = new PrintWriter(System.out);
//        out = new PrintWriter(outputFilename);

        int t = isDebug ? nextInt() : 1;
//        int t = nextInt();
//        int t = 1;
        for (int i = 0; i < t; i++) {
//            out.print("Case #" + (i + 1) + ": ");
            solve();
            out.flush();
        }

        in.close();
        out.flush();
        out.close();
    }

    private void println(Object... objects) {
        boolean isFirst = true;
        for (Object o : objects) {
            if (!isFirst) {
                out.print(" ");
            } else {
                isFirst = false;
            }
            out.print(o.toString());
        }
        out.println();
    }

    private int[] nextIntArray(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = nextInt();
        }
        return res;
    }

    private long[] nextLongArray(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nextLong();
        }
        return res;
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    private String nextToken() throws IOException {
        while (line == null || !line.hasMoreTokens()) {
            line = new StringTokenizer(in.readLine());
        }
        return line.nextToken();
    }

    private static void assertPredicate(boolean p) {
        if (!p) {
            throw new RuntimeException();
        }
    }

    private static void assertPredicate(boolean p, String message) {
        if (!p) {
            throw new RuntimeException(message);
        }
    }

    private static void assertNotEqual(int unexpected, int actual) {
        if (actual == unexpected) {
            throw new RuntimeException("assertNotEqual: " + unexpected + " == " + actual);
        }
    }

    private static void assertEqual(int expected, int actual) {
        if (expected != actual) {
            throw new RuntimeException("assertEqual: " + expected + " != " + actual);
        }
    }
}


import java.util.*;
public class Main{
    public static void main(String[] args) throws Exception{
        Scanner scn=new Scanner(System.in);
        int t=scn.nextInt();
        while(t-->0){
            int n=scn.nextInt();
            // if(n!=0){
                // n=(int)Math.pow(2,n);
                System.out.println(n-1);
            // }
            // else{

            // }
        }
    }
}


import java.util.*;
public class M1{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t>0){
            int n = sc.nextInt();
            System.out.println(Math.pow(2,n)-1);
            t--;
        }
}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Solution {
    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int T = fs.nextInt();

        while (T-- > 0) {
            int n = fs.nextInt();
            if (n <= 2) {
                out.println(1);
            } else {
                long val = 1;
                for (int i = 0; i < n; i++) {
                    val *= 2;
                }
                out.println(val - 1);
            }
        }

        out.close();
    }

    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

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

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

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

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

}


import java.util.*;
import java.io.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;

public class Main {
    public static final Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int t = sc.nextInt();
        for(int i=0;i<t;i++)
        {
            solve();
        }

    }

    public static void solve()
    {
       int n = sc.nextInt();
	   int zz = (int)(Math.pow(2,n));
	  // System.out.println(zz);
	  ArrayList<Integer> br = new ArrayList<>();
	  for(int i=0;i<zz;i++)
	  {
		  br.add(i+1);
	  }
	  System.out.println(br);

	  ArrayList<Integer> ar = new ArrayList<>();
	  int j=1;

	  while(j<=n){
	  for(int i=1;i<br.size();i++)
	  {
          if((br.get(i)+br.get(i-1))%2!=0)
		  {
			  ar.add(br.get(i-1));
		  }
		  else
		  {
               ar.add(br.get(i));
		  }
		  i++;
	  }
	  j++;
	  br.clear();
	  for(int kk = 0 ;kk<ar.size();kk++)
	  {
		  br.add(ar.get(kk));
	  }
	  ar.clear();
	}
	System.out.println(br.get(0));
	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int input = sc.nextInt();
		for (int i = 1; i < input; i++) {
			System.out.println(sc.nextInt());
		}
		sc.close();
	}

	static int solve(int n) {
		return (int) (Math.pow(2, n) -1);
	}
}


        import java.util.*;
public class Program
{
    public static void main(String[] args) {
       Scanner sn = new Scanner(System.in);
       int t = sn.nextInt() , n ;
       while(t-- > 0)
       {
           n = sn.nextInt() ;
           int m =(int) Math.pow(2,n);
           int sum = 0 ;
           for (int i = 1 ; i <= m ; i++)
               sum +=i;

           if(n == 1)
              System.out.println(n);
           else
             System.out.println(sum/(n+(n-1)));
       }

    }
}


import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class check
{
  public static void main(String[] args) throws IOException
  {
    Scanner sc= new Scanner();
    int n=sc.nextInt();
    while(n-->0)
    {
    //   System.out.println((int)Math.pow(2, sc.nextInt())-1);
    System.out.println(n);
    }
  }
  static class Scanner//Reader
  {
    final private int BUFFER_SIZE = 1 << 16;
    private DataInputStream din;
    private byte[] buffer;
    private int bufferPointer, bytesRead;
    public Scanner()
    {
      din = new DataInputStream(System.in);
      buffer = new byte[BUFFER_SIZE];
      bufferPointer = bytesRead = 0;
    }
    public Scanner(String file_name) throws IOException
    {
      din = new DataInputStream(new FileInputStream(file_name));
      buffer = new byte[BUFFER_SIZE];
      bufferPointer = bytesRead = 0;
    }
    public String nextLine() throws IOException
    {
      byte[] buf = new byte[1<<16]; // line length
      int cnt = 0, c;
      while ((c = read()) != -1)
      {
        if (c == 10)
          if (cnt != 0)
            break;
          else
            continue;
        buf[cnt++] = (byte)c;
      }
      return new String(buf, 0, cnt-1);
    }
    public int nextInt() throws IOException
    {
      int ret = 0;
      byte c = read();
      while (c <= ' ')
        c = read();
      boolean neg = (c == '-');
      if (neg)
        c = read();
      do
      {
        ret = ret * 10 + c - '0';
      } while ((c = read()) >= '0' && c <= '9');
      if (neg)
        return -ret;
      return ret;
    }
    public long nextLong() throws IOException
    {
      long ret = 0;
      byte c = read();
      while (c <= ' ')
        c = read();
      boolean neg = (c == '-');
      if (neg)
        c = read();
      do
      {
        ret = ret * 10 + c - '0';
      } while ((c = read()) >= '0' && c <= '9');
      if (neg)
        return -ret;
      return ret;
    }
    public double nextDouble() throws IOException
    {
      double ret = 0, div = 1;
      byte c = read();
      while (c <= ' ')
        c = read();
      boolean neg = (c == '-');
      if (neg)
        c = read();
      do
      {
        ret = ret * 10 + c - '0';
      } while ((c = read()) >= '0' && c <= '9');
      if (c == '.')
      {
        while ((c = read()) >= '0' && c <= '9')
          ret += (c - '0') / (div *= 10);
      }
      if (neg)
        return -ret;
      return ret;
    }
    private void fillBuffer() throws IOException
    {
      bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
      if (bytesRead == -1)
        buffer[0] = -1;
    }
    private byte read() throws IOException
    {
      if (bufferPointer == bytesRead)
        fillBuffer();
      return buffer[bufferPointer++];
    }
    public void close() throws IOException
    {
      if (din == null)
        return;
      din.close();
    }
  }
}