#include #define REP(i,n) for(int i=0,i##_len=int(n);i>s; int ans = 0; for(int bit = 0; bit < (1<<(s.size()-1));bit++ ) { ll num = 0; ll num_tmp = 0; for( int i = 0; i < s.size(); i++) { num_tmp *= 10; num_tmp += s[i] - '0'; if( bit >> i & 1 ) { num += num_tmp; num_tmp = 0; } } num += num_tmp; bool prime = true; if( num == 0 || num == 1) continue; for(ll i = 2; i < sqrt(num) + 1;i++ ) { if( num%i == 0 ) { prime = false; break; } } //cerr << num << " " << (prime ? "prime" : "false") << endl; if(prime) ans++; } cout << ans <