#include #define all(vec) vec.begin(),vec.end() using namespace std; using ll=long long; using P=pair; const ll INF=1LL<<30; const ll LINF=1LL<<61; const double eps=1e-9; const ll MOD=1e9+7; int main(){ int n,m;cin>>n>>m; vector> G(n); string s;cin>>s; vector p(n),a(n); for(int i=0;i>u>>v;--u;--v; G[u].push_back(v); G[v].push_back(u); if(s[u]=='P')p[v]++; if(s[u]=='A')a[v]++; if(s[v]=='P')p[u]++; if(s[v]=='A')a[u]++; } ll ans=0; for(int i=0;i