#include #include #include #include using namespace std; int main(){ string S; cin >> S; int M; cin >> M; int ans = 0; int len = S.size(); map cnt; for( int i = 0 ; i < len; i++){ long long hash = 0; for( int j = 0; j < 10 && i+j > C; int size=C.size(); long long hash=0; long long offset=1LL; for( int j = 0 ; j < size; j++ ){ hash*=27; hash+=C[j]-'A'+1; offset*=27; } ans+=cnt[hash]; } cout << ans << endl; }