#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 *, ...);
int main() {
  char a[4];
  int x = 0;
  int n;
  scanf("%d", &n);
  while (n--) {
    scanf("%s", a);
    if ((a[0] == '+') || (a[2] == '+'))
      x++;
    else if ((a[0] == '-') || (a[2] == '-'))
      x--;
  }
  printf("%d\n", x);
  x = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     11c3 <main+0xa3>
lea    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x8(%rbp),%eax
cmp    $0x2b,%eax
je     1188 <main+0x68>
movsbl -0x6(%rbp),%eax
cmp    $0x2b,%eax
jne    1196 <main+0x76>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11be <main+0x9e>
movsbl -0x8(%rbp),%eax
cmp    $0x2d,%eax
je     11b0 <main+0x90>
movsbl -0x6(%rbp),%eax
cmp    $0x2d,%eax
jne    11b9 <main+0x99>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11be <main+0x9e>
jmp    1148 <main+0x28>
mov    -0xc(%rbp),%esi
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
xor    %ebx,%ebx
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,(%rsp)
jb     119e <main+0x7e>
lea    0xebc(%rip),%r14
lea    0x4(%rsp),%r15
mov    $0x1,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movzbl 0x4(%rsp),%eax
movzbl 0x6(%rsp),%ecx
cmp    $0x2d,%al
sete   %sil
cmp    $0x2d,%cl
sete   %dl
or     %sil,%dl
movzbl %dl,%edx
neg    %edx
cmp    $0x2b,%cl
cmove  %ebp,%edx
cmp    $0x2b,%al
cmove  %ebp,%edx
add    %edx,%ebx
subl   $0x1,(%rsp)
jae    1160 <main+0x40>
lea    0xe61(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
br label %6
6: ; preds = %39, %0
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %40
10: ; preds = %6
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 43
br i1 %16, label %22, label %17
17: ; preds = %10
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 43
br i1 %21, label %22, label %25
22: ; preds = %17, %10
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %39
25: ; preds = %17
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 45
br i1 %29, label %35, label %30
30: ; preds = %25
%31 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 45
br i1 %34, label %35, label %38
35: ; preds = %30, %25
%36 = load i32, i32* %3
%37 = add nsw i32 %36, -1
store i32 %37, i32* %3
br label %38
38: ; preds = %35, %30
br label %39
39: ; preds = %38, %22
br label %6
40: ; preds = %6
%41 = load i32, i32* %3
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %41)
store i32 0, i32* %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
store i32 %7, i32* %2
%8 = icmp eq i32 %6, 0
br i1 %8, label %28, label %9
9: ; preds = %0
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 2
br label %11
11: ; preds = %9, %11
%12 = phi i32 [ 0, %9 ], [ %24, %11 ]
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%14 = load i8, i8* %3
%15 = icmp eq i8 %14, 43
%16 = load i8, i8* %10
%17 = icmp eq i8 %16, 43
%18 = select i1 %15, i1 true, i1 %17
%19 = icmp eq i8 %14, 45
%20 = icmp eq i8 %16, 45
%21 = select i1 %19, i1 true, i1 %20
%22 = sext i1 %21 to i32
%23 = select i1 %18, i32 1, i32 %22
%24 = add nsw i32 %12, %23
%25 = load i32, i32* %2
%26 = add nsw i32 %25, -1
store i32 %26, i32* %2
%27 = icmp eq i32 %25, 0
br i1 %27, label %28, label %11
28: ; preds = %11, %0
%29 = phi i32 [ 0, %0 ], [ %24, %11 ]
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %29)
ret i32 0
}