import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] m = new int[n]; for(int m_i=0; m_i < n; m_i++){ m[m_i] = in.nextInt(); } int all=1; int count=0; for(int m_i=0; m_i < n-1; m_i++){ if (m[m_i] > m[m_i+1]){ all*=Math.pow(2,count); count=-1; } // System.out.println(count); count++; } all*=Math.pow(2,count); System.out.println(all); // your code goes here } }