#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 */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
char *strchr(char *, char);
int main() {
  int n;
  scanf("%d", &n);
  char rock[n][101];
  int i, j;
  for (i = 0; i < n; i++) {
    scanf("%s", rock[i]);
  }
  int array[26];
  for (j = 0; j < 26; j++) {
    array[j] = 0;
  }
  char char_int = 97;
  char *result = NULL;
  for (j = 0; j < 26; j++) {
    for (i = 0; i < n; i++) {
      result = strchr(rock[i], char_int);
      if (result != NULL) {
        array[j]++;
      }
    }
    char_int++;
  }
  int count = 0;
  for (j = 0; j < 26; j++) {
    if (array[j] == n) {
      count++;
    }
  }
  printf("%d", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
imul   $0x65,%rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xb0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11bf <main+0x8f>
mov    -0xb0(%rbp),%rsi
movslq -0x1c(%rbp),%rax
imul   $0x65,%rax,%rax
add    %rax,%rsi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1185 <main+0x55>
movl   $0x0,-0x20(%rbp)
cmpl   $0x1a,-0x20(%rbp)
jge    11ed <main+0xbd>
movslq -0x20(%rbp),%rax
movl   $0x0,-0x90(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11c6 <main+0x96>
movb   $0x61,-0x91(%rbp)
movq   $0x0,-0xa0(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x1a,-0x20(%rbp)
jge    129a <main+0x16a>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    127e <main+0x14e>
mov    -0xb0(%rbp),%rdi
movslq -0x1c(%rbp),%rax
imul   $0x65,%rax,%rax
add    %rax,%rdi
movsbl -0x91(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0xa0(%rbp)
cmpq   $0x0,-0xa0(%rbp)
je     126b <main+0x13b>
movslq -0x20(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x90(%rbp,%rax,4)
jmp    1270 <main+0x140>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1217 <main+0xe7>
mov    -0x91(%rbp),%al
add    $0x1,%al
mov    %al,-0x91(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1206 <main+0xd6>
movl   $0x0,-0xa4(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x1a,-0x20(%rbp)
jge    12eb <main+0x1bb>
movslq -0x20(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
cmp    -0x8(%rbp),%eax
jne    12d8 <main+0x1a8>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    12dd <main+0x1ad>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12ab <main+0x17b>
mov    -0xa4(%rbp),%esi
lea    0xd08(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
lea    0xeb5(%rip),%rdi
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rsp,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
imul   $0x65,%rax,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    -0x2c(%rbp),%eax
test   %eax,%eax
jle    11ae <main+0x7e>
lea    0xe7f(%rip),%r14
mov    -0x38(%rbp),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
add    $0x65,%r15
cmp    %rax,%rbx
jl     1190 <main+0x60>
xorps  %xmm0,%xmm0
movaps %xmm0,-0x60(%rbp)
movaps %xmm0,-0x70(%rbp)
movaps %xmm0,-0x80(%rbp)
movaps %xmm0,-0x90(%rbp)
movaps %xmm0,-0xa0(%rbp)
movaps %xmm0,-0xb0(%rbp)
movq   $0x0,-0x50(%rbp)
mov    %eax,%r12d
mov    $0x61,%r13b
xor    %r15d,%r15d
jmp    11fe <main+0xce>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r13b
add    $0x1,%r15
cmp    $0x1a,%r15
je     1236 <main+0x106>
test   %r12d,%r12d
jle    11f0 <main+0xc0>
mov    %r12,%r14
mov    -0x38(%rbp),%rbx
jmp    121a <main+0xea>
nopl   0x0(%rax)
add    $0x65,%rbx
add    $0xffffffffffffffff,%r14
je     11f0 <main+0xc0>
movsbl %r13b,%esi
mov    %rbx,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
je     1210 <main+0xe0>
addl   $0x1,-0xb0(%rbp,%r15,4)
ff 01
jmp    1210 <main+0xe0>
movd   %r12d,%xmm0
xor    %eax,%eax
cmp    %r12d,-0x50(%rbp)
sete   %al
xor    %ecx,%ecx
cmp    %r12d,-0x4c(%rbp)
pshufd $0x0,%xmm0,%xmm0
sete   %cl
movdqa -0x80(%rbp),%xmm1
pcmpeqd %xmm0,%xmm1
movdqa -0x90(%rbp),%xmm2
ff
pcmpeqd %xmm0,%xmm2
packssdw %xmm1,%xmm2
movdqa -0xa0(%rbp),%xmm1
ff
pcmpeqd %xmm0,%xmm1
movdqa -0xb0(%rbp),%xmm3
ff
pcmpeqd %xmm0,%xmm3
packssdw %xmm1,%xmm3
packsswb %xmm2,%xmm3
pmovmskb %xmm3,%edx
mov    %edx,%esi
shr    %esi
and    $0x5555,%esi
sub    %esi,%edx
mov    %edx,%esi
and    $0x3333,%esi
shr    $0x2,%edx
and    $0x3333,%edx
add    %esi,%edx
mov    %edx,%esi
shr    $0x4,%esi
add    %edx,%esi
and    $0xf0f,%esi
mov    %esi,%edx
shl    $0x8,%edx
add    %esi,%edx
movzbl %dh,%edx
movdqa -0x60(%rbp),%xmm1
pcmpeqd %xmm0,%xmm1
pcmpeqd -0x70(%rbp),%xmm0
packssdw %xmm1,%xmm0
packsswb %xmm0,%xmm0
pmovmskb %xmm0,%esi
mov    %esi,%ebx
shr    %bl
and    $0x55,%bl
sub    %bl,%sil
mov    %esi,%ebx
and    $0x33,%bl
shr    $0x2,%sil
and    $0x33,%sil
add    %bl,%sil
mov    %esi,%ebx
shr    $0x4,%bl
add    %sil,%bl
and    $0xf,%bl
movzbl %bl,%esi
add    %edx,%esi
add    %eax,%esi
add    %ecx,%esi
lea    0xcec(%rip),%rdi
call   1040 <printf@plt>
mov    -0x40(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca [26 x i32]
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %3
%15 = alloca [101 x i8], i64 %13
store i64 %13, i64* %4
store i32 0, i32* %5
br label %16
16: ; preds = %26, %0
%17 = load i32, i32* %5
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [101 x i8], [101 x i8]* %15, i64 %22
%24 = getelementptr inbounds [101 x i8], [101 x i8]* %23, i64 0, i64 0
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %20
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %16
29: ; preds = %16
store i32 0, i32* %6
br label %30
30: ; preds = %37, %29
%31 = load i32, i32* %6
%32 = icmp slt i32 %31, 26
br i1 %32, label %33, label %40
33: ; preds = %30
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [26 x i32], [26 x i32]* %7, i64 0, i64 %35
store i32 0, i32* %36
br label %37
37: ; preds = %33
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %30
40: ; preds = %30
store i8 97, i8* %8
store i8* null, i8** %9
store i32 0, i32* %6
br label %41
41: ; preds = %71, %40
%42 = load i32, i32* %6
%43 = icmp slt i32 %42, 26
br i1 %43, label %44, label %74
44: ; preds = %41
store i32 0, i32* %5
br label %45
45: ; preds = %65, %44
%46 = load i32, i32* %5
%47 = load i32, i32* %2
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %68
49: ; preds = %45
%50 = load i32, i32* %5
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [101 x i8], [101 x i8]* %15, i64 %51
%53 = getelementptr inbounds [101 x i8], [101 x i8]* %52, i64 0, i64 0
%54 = load i8, i8* %8
%55 = call i8* @strchr(i8* %53, i8 signext %54)
store i8* %55, i8** %9
%56 = load i8*, i8** %9
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %64
58: ; preds = %49
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [26 x i32], [26 x i32]* %7, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = add nsw i32 %62, 1
store i32 %63, i32* %61
br label %64
64: ; preds = %58, %49
br label %65
65: ; preds = %64
%66 = load i32, i32* %5
%67 = add nsw i32 %66, 1
store i32 %67, i32* %5
br label %45
68: ; preds = %45
%69 = load i8, i8* %8
%70 = add i8 %69, 1
store i8 %70, i8* %8
br label %71
71: ; preds = %68
%72 = load i32, i32* %6
%73 = add nsw i32 %72, 1
store i32 %73, i32* %6
br label %41
74: ; preds = %41
store i32 0, i32* %10
store i32 0, i32* %6
br label %75
75: ; preds = %89, %74
%76 = load i32, i32* %6
%77 = icmp slt i32 %76, 26
br i1 %77, label %78, label %92
78: ; preds = %75
%79 = load i32, i32* %6
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [26 x i32], [26 x i32]* %7, i64 0, i64 %80
%82 = load i32, i32* %81
%83 = load i32, i32* %2
%84 = icmp eq i32 %82, %83
br i1 %84, label %85, label %88
85: ; preds = %78
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
store i32 %87, i32* %10
br label %88
88: ; preds = %85, %78
br label %89
89: ; preds = %88
%90 = load i32, i32* %6
%91 = add nsw i32 %90, 1
store i32 %91, i32* %6
br label %75
92: ; preds = %75
%93 = load i32, i32* %10
%94 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %93)
store i32 0, i32* %1
%95 = load i8*, i8** %3
%96 = load i32, i32* %1
ret i32 %96
}

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