#include using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define ll long long const long long mod=998244353; const long long hmod=46216567629137; int main(){ cin.tie(0)->sync_with_stdio(0); cout.tie(0); int L; string S; cin>>L>>S; if(S=="Beat") L++; int dat[5]={390,429,468,507,546}; cout<