#include using namespace std; using ll=long long; #define rep2(i, a, n) for(int i = (a); i < (n); i++) #define rep(i, n) rep2(i,0,n) int main(){ cin.tie(nullptr);ios_base::sync_with_stdio(false); int l,n; cin>>l>>n; int hoge[l]; hoge[0]=1; rep2(i,1,l){ hoge[i]=hoge[i-1]*2; } string s[n]; ll res=0; rep(i,n){ cin>>s[i]; res+=hoge[l-s[i].size()]; } cout<