#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve(){
int n, m;
cin >> n >> m;
int f = 0, r = 0;
for(int i = 0; i < n; i++){
string s;
cin >> s;
for(int j = 0; j < m; j++){
if(s[j] == 'F') f = 1;
if(s[j] == 'R') r = 1;
}
}
cout << f + r << endl;
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t = 1;
while(t--) solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |