#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 *, double);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  double resul = 1;
  int N, X;
  char OP;
  scanf(" %d", &N);
  while (N > 0) {
    scanf(" %d %c", &X, &OP);
    switch (OP) {
    case '*':
      resul *= X;
      break;
    case '/':
      resul /= X;
      break;
    }
    N--;
  }
  printf("%0.0lf", resul);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    11c9 <main+0xa9>
lea    0xead(%rip),%rdi
xor    %eax,%eax
lea    -0x18(%rbp),%rsi
lea    -0x19(%rbp),%rdx
call   1040 <scanf@plt>
movsbl -0x19(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x2a,%eax
je     1194 <main+0x74>
jmp    1183 <main+0x63>
mov    -0x20(%rbp),%eax
sub    $0x2f,%eax
je     11a8 <main+0x88>
jmp    11bb <main+0x9b>
cvtsi2sdl -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11bb <main+0x9b>
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <main+0x2e>
movsd  -0x10(%rbp),%xmm0
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xed8(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11cd <main+0xad>
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0xeb0(%rip),%r14
lea    0x1c(%rsp),%r15
lea    0xb(%rsp),%rbx
jmp    1199 <main+0x79>
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sdl 0x1c(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x1,%eax
jle    11db <main+0xbb>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
movsbl 0xb(%rsp),%eax
cmp    $0x2f,%eax
je     1170 <main+0x50>
cmp    $0x2a,%eax
jne    1189 <main+0x69>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x1c(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
jmp    1183 <main+0x63>
movsd  0xe2b(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0xe31(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
@.str.1 = [7 x i8] c" %d %c\00"
@.str.2 = [7 x i8] c"%0.0lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 0, i32* %1
store double 1.000000e+00, double* %2
%6 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %7
7: ; preds = %24, %0
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %4, i8* %5)
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
switch i32 %13, label %24 [
i32 42, label %14
i32 47, label %19
]
14: ; preds = %10
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to double
%17 = load double, double* %2
%18 = fmul double %17, %16
store double %18, double* %2
br label %24
19: ; preds = %10
%20 = load i32, i32* %4
%21 = sitofp i32 %20 to double
%22 = load double, double* %2
%23 = fdiv double %22, %21
store double %23, double* %2
br label %24
24: ; preds = %10, %19, %14
%25 = load i32, i32* %3
%26 = add nsw i32 %25, -1
store i32 %26, i32* %3
br label %7
27: ; preds = %7
%28 = load double, double* %2
%29 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
@.str.1 = [7 x i8] c" %d %c\00"
@.str.2 = [7 x i8] c"%0.0lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %27
9: ; preds = %0, %22
%10 = phi double [ %23, %22 ], [ 1.000000e+00, %0 ]
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2, i8* %3)
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
switch i32 %13, label %22 [
i32 42, label %14
i32 47, label %18
]
14: ; preds = %9
%15 = load i32, i32* %2
%16 = sitofp i32 %15 to double
%17 = fmul double %10, %16
br label %22
18: ; preds = %9
%19 = load i32, i32* %2
%20 = sitofp i32 %19 to double
%21 = fdiv double %10, %20
br label %22
22: ; preds = %9, %18, %14
%23 = phi double [ %10, %9 ], [ %21, %18 ], [ %17, %14 ]
%24 = load i32, i32* %1
%25 = add nsw i32 %24, -1
store i32 %25, i32* %1
%26 = icmp sgt i32 %24, 1
br i1 %26, label %9, label %27
27: ; preds = %22, %0
%28 = phi double [ 1.000000e+00, %0 ], [ %23, %22 ]
%29 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %28)
ret i32 0
}