Burger Stand (UVA 13048) by aizu_f
Contest: 3738    RunID: 20173638    Status: Compilation error    Date: Sat Oct 14 14:01:29 JST 2017


#include <bits/stdc++.h>
#include<set>
#include<algorithm>
#include<cmath>
#include<sstream>
#include<stdio.h>
#define INF 100000000
#include<map>

int main() {
	int n, caseT = 0;
	scanf("%d", &n);
	string s;
	getline(cin, s);
	for(int i = 1; i <= n; i++){
		string str;
		getline(cin, str);
		int cnt = 0;
		for(int j = 0; j < str.size(); j++){
			if(str[i] == '-'){
				int w = 0;
				if(i + 1 < str.size() && str[i + 1] == 'B') w++;
				if(i + 2 < str.size() && str[i + 2] == 'B') w++;
				if(i + 1 < str.size() && str[i + 1] == 'S') w++;
				if(i >= 1 && str[i - 1] == 'S') w++;
				if(w == 0) cnt++;
			}
		}
		printf("Case %d: %d\n", i, cnt);
	}
	return 0;
}