#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
scalar_t__ scanf(char *, ...);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int i, j, t, n, scarecrow;
  char field[n];
  fflush(stdin);
  while (scanf("%d", &t) != EOF) {
    if (t > 100)
      exit(1);
    for (i = 1; i <= t; i++) {
      scanf("%d", &n);
      if (n <= 0 || n >= 100)
        exit(1);
      scanf("%s", field);
      for (j = 0, scarecrow = 0; j < n; j++) {
        if (field[j] == '.') {
          scarecrow++;
          j += 2;
        }
      }
      printf("Case %d: %d\n", i, scarecrow);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x20(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe6f(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    0x2e3d(%rip),%rcx
cmp    (%rcx),%rax
je     128e <main+0x14e>
cmpl   $0x64,-0x1c(%rbp)
jle    11c0 <main+0x80>
mov    $0x1,%edi
call   1060 <exit@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1289 <main+0x149>
lea    0xe26(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0x0,-0x20(%rbp)
jle    11f9 <main+0xb9>
cmpl   $0x64,-0x20(%rbp)
jl     1203 <main+0xc3>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x40(%rbp),%rsi
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1269 <main+0x129>
mov    -0x40(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1256 <main+0x116>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    125b <main+0x11b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1223 <main+0xe3>
mov    -0x14(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xd90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c7 <main+0x87>
jmp    118a <main+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsp,0x10(%rsp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe98(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e65(%rip),%rcx
cmp    (%rcx),%rax
jne    1196 <main+0x56>
mov    0x10(%rsp),%rsp
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe63(%rip),%rbx
lea    0xe5f(%rip),%r12
mov    %rsp,%r13
lea    0xe58(%rip),%rbp
jmp    11cb <main+0x8b>
mov    %rbx,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e1a(%rip),%rcx
cmp    (%rcx),%rax
je     1180 <main+0x40>
mov    0x8(%rsp),%eax
cmp    $0x64,%eax
jg     1267 <main+0x127>
test   %eax,%eax
jle    11b0 <main+0x70>
mov    $0x1,%r14d
jmp    120c <main+0xcc>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %r15d,%edx
call   1030 <printf@plt>
lea    0x1(%r14),%eax
cmp    0x8(%rsp),%r14d
mov    %eax,%r14d
jge    11b0 <main+0x70>
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffff9c,%eax
cmp    $0xffffff9c,%eax
jbe    1267 <main+0x127>
xor    %r15d,%r15d
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11f0 <main+0xb0>
mov    (%rsp),%cl
xor    %edx,%edx
cmp    $0x2e,%cl
sete   %dl
xor    %r15d,%r15d
xor    %esi,%esi
nop
lea    0x2(%rsi),%edi
cmp    $0x2e,%cl
cmovne %esi,%edi
add    %edx,%r15d
add    $0x1,%edi
mov    %edi,%esi
cmp    %eax,%edi
jl     1250 <main+0x110>
jmp    11f0 <main+0xb0>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [13 x i8] c"Case %d: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %9
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %11
%16 = alloca i8, i64 %14
store i64 %14, i64* %12
%17 = load i32, i32* @stdin
%18 = call i32 @fflush(i32 %17)
br label %19
19: ; preds = %71, %2
%20 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%21 = load i64, i64* @EOF
%22 = icmp ne i64 %20, %21
br i1 %22, label %23, label %72
23: ; preds = %19
%24 = load i32, i32* %8
%25 = icmp sgt i32 %24, 100
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %23
store i32 1, i32* %6
br label %29
29: ; preds = %68, %28
%30 = load i32, i32* %6
%31 = load i32, i32* %8
%32 = icmp sle i32 %30, %31
br i1 %32, label %33, label %71
33: ; preds = %29
%34 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%35 = load i32, i32* %9
%36 = icmp sle i32 %35, 0
br i1 %36, label %40, label %37
37: ; preds = %33
%38 = load i32, i32* %9
%39 = icmp sge i32 %38, 100
br i1 %39, label %40, label %42
40: ; preds = %37, %33
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %37
%43 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %16)
store i32 0, i32* %7
store i32 0, i32* %10
br label %44
44: ; preds = %61, %42
%45 = load i32, i32* %7
%46 = load i32, i32* %9
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %64
48: ; preds = %44
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %16, i64 %50
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 46
br i1 %54, label %55, label %60
55: ; preds = %48
%56 = load i32, i32* %10
%57 = add nsw i32 %56, 1
store i32 %57, i32* %10
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 2
store i32 %59, i32* %7
br label %60
60: ; preds = %55, %48
br label %61
61: ; preds = %60
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %44
64: ; preds = %44
%65 = load i32, i32* %6
%66 = load i32, i32* %10
%67 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %65, i32 %66)
br label %68
68: ; preds = %64
%69 = load i32, i32* %6
%70 = add nsw i32 %69, 1
store i32 %70, i32* %6
br label %29
71: ; preds = %29
br label %19
72: ; preds = %19
store i32 0, i32* %3
%73 = load i8*, i8** %11
%74 = load i32, i32* %3
ret i32 %74
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [13 x i8] c"Case %d: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [0 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = tail call i8* @llvm.stacksave()
%9 = getelementptr inbounds [0 x i8], [0 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = tail call i32 @fflush(i32 %10)
%12 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%13 = load i64, i64* @EOF
%14 = icmp eq i64 %12, %13
br i1 %14, label %58, label %15
15: ; preds = %2
%16 = getelementptr inbounds [0 x i8], [0 x i8]* %3, i64 0, i64 0
br label %21
17: ; preds = %52, %24
%18 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%19 = load i64, i64* @EOF
%20 = icmp eq i64 %18, %19
br i1 %20, label %58, label %21
21: ; preds = %15, %17
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 100
br i1 %23, label %26, label %24
24: ; preds = %21
%25 = icmp slt i32 %22, 1
br i1 %25, label %17, label %28
26: ; preds = %21
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %24, %52
%29 = phi i32 [ %55, %52 ], [ 1, %24 ]
%30 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%31 = load i32, i32* %5
%32 = add i32 %31, -100
%33 = icmp ult i32 %32, -99
br i1 %33, label %34, label %36
34: ; preds = %28
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %28
%37 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%38 = load i32, i32* %5
%39 = icmp sgt i32 %38, 0
br i1 %39, label %40, label %52
40: ; preds = %36
%41 = load i8, i8* %16
%42 = icmp eq i8 %41, 46
%43 = zext i1 %42 to i32
br label %44
44: ; preds = %40, %44
%45 = phi i32 [ %49, %44 ], [ 0, %40 ]
%46 = phi i32 [ %50, %44 ], [ 0, %40 ]
%47 = add nsw i32 %46, 2
%48 = select i1 %42, i32 %47, i32 %46
%49 = add nuw nsw i32 %45, %43
%50 = add nsw i32 %48, 1
%51 = icmp slt i32 %50, %38
br i1 %51, label %44, label %52
52: ; preds = %44, %36
%53 = phi i32 [ 0, %36 ], [ %49, %44 ]
%54 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %29, i32 %53)
%55 = add nuw nsw i32 %29, 1
%56 = load i32, i32* %4
%57 = icmp slt i32 %29, %56
br i1 %57, label %28, label %17
58: ; preds = %17, %2
ret i32 0
}