import java.util.*; import java.io.*; class Main{ static int count; public static void main(String args[]){ int n=readI(); int a[]=readIs(),b[]=readIs(); boolean flg[]=new boolean[n]; count=0; func(n,a,b,0,flg,0,0); pl(count+""); } public static int func(int n,int[] a,int[] b,int max,boolean[] flg,int now,int sum){ if(now==n){ if(max