#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 *, unsigned long long);
int /*<<< orphan*/ scanf(char *, unsigned long long *);
int main() {
  unsigned long long int n, s = 0;
  scanf("%llu", &n);
  if (n % 2 == 0)
    s = n / 2 * (n + 1);
  else
    s = (n + 1) / 2 * n;
  printf("%llu", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1176 <main+0x56>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    118b <main+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shr    $0x1,%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rsi
test   $0x1,%sil
jne    1146 <main+0x26>
mov    %rsi,%rax
shr    %rax
add    $0x1,%rsi
jmp    114d <main+0x2d>
lea    0x1(%rsi),%rax
shr    %rax
imul   %rax,%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%llu\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
%6 = urem i64 %5, 2
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i64, i64* %2
%10 = udiv i64 %9, 2
%11 = load i64, i64* %2
%12 = add i64 %11, 1
%13 = mul i64 %10, %12
store i64 %13, i64* %3
br label %20
14: ; preds = %0
%15 = load i64, i64* %2
%16 = add i64 %15, 1
%17 = udiv i64 %16, 2
%18 = load i64, i64* %2
%19 = mul i64 %17, %18
store i64 %19, i64* %3
br label %20
20: ; preds = %14, %8
%21 = load i64, i64* %3
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = and i64 %4, 1
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = lshr i64 %4, 1
%9 = add nuw i64 %4, 1
%10 = mul i64 %8, %9
br label %15
11: ; preds = %0
%12 = add i64 %4, 1
%13 = lshr i64 %12, 1
%14 = mul i64 %13, %4
br label %15
15: ; preds = %11, %7
%16 = phi i64 [ %10, %7 ], [ %14, %11 ]
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %16)
ret i32 0
}