forked from ngthanhtrung23/CompetitiveProgramming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathD1.cpp
More file actions
51 lines (48 loc) · 973 Bytes
/
D1.cpp
File metadata and controls
51 lines (48 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
using namespace std;
typedef long long ll;
typedef double R;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, s, t) for(i = (s); i < (t); i++)
#define RFOR(i, s, t) for(i = (s)-1; i >= (t); i--)
const R PI = acos(-1);
const int MAXN = 105;
const int P = 1e9+7;
char s[MAXN];
int main(){
#ifdef LOCAL
freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#endif
int r, c;
int i, j;
int cnt = 0;
scanf("%d%d", &r, &c);
for(i = 0; i < r; i++)
scanf("%s", s);
for(i = 0; i < c; i++){
if(s[i] == 'B'){
if(i == 0 || s[i-1] == '.')
cnt++;
}
}
printf("%d\n", cnt);
return 0;
}