#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m; cin >> n >> m;
string s = "", t;
while (n--)
{
cin >> t;
s += t;
}
int ans = 0;
for (char c : s) ans += (c == 'N' ? 2 : (c == 'E' || c == 'W' ? 1 : 0));
cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |