#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 *, long);
int scanf(char *, long *);
int main() {
  long i, n, o, p, s;
  while (scanf("%ld", &n) == 1) {
    p = ((n + 1) / 2) * ((n + 1) / 2);
    o = (p * 2) - 1;
    s = 0;
    for (i = o; i >= (o - 4); i -= 2)
      s += i;
    printf("%ld\n", s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11e6 <main+0xc6>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x4,%rcx
cmp    %rcx,%rax
jl     11d1 <main+0xb1>
mov    -0x10(%rbp),%rax
add    -0x30(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    119f <main+0x7f>
mov    -0x30(%rbp),%rsi
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11d7 <main+0xb7>
lea    0xeba(%rip),%r14
lea    0xeaf(%rip),%r15
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%rsp),%rax
lea    0x1(%rax),%rcx
shr    $0x3f,%rcx
add    %rcx,%rax
add    $0x1,%rax
sar    %rax
imul   %rax,%rax
lea    (%rax,%rax,1),%rcx
lea    (%rax,%rax,1),%rdx
add    $0xffffffffffffffff,%rdx
lea    (%rax,%rax,1),%rsi
add    $0xfffffffffffffffc,%rsi
cmp    %rsi,%rdx
cmovl  %rdx,%rsi
sub    %rsi,%rcx
shr    %rcx
lea    (%rax,%rax,1),%rdx
add    $0xfffffffffffffffd,%rdx
imul   %rcx,%rdx
lea    -0x1(%rcx),%rdi
imul   %rcx,%rdi
and    $0xfffffffffffffffe,%rdi
lea    (%rdx,%rax,2),%rsi
add    $0xffffffffffffffff,%rsi
sub    %rdi,%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
br label %7
7: ; preds = %34, %0
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %3)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %37
10: ; preds = %7
%11 = load i64, i64* %3
%12 = add nsw i64 %11, 1
%13 = sdiv i64 %12, 2
%14 = load i64, i64* %3
%15 = add nsw i64 %14, 1
%16 = sdiv i64 %15, 2
%17 = mul nsw i64 %13, %16
store i64 %17, i64* %5
%18 = load i64, i64* %5
%19 = mul nsw i64 %18, 2
%20 = sub nsw i64 %19, 1
store i64 %20, i64* %4
store i64 0, i64* %6
%21 = load i64, i64* %4
store i64 %21, i64* %2
br label %22
22: ; preds = %31, %10
%23 = load i64, i64* %2
%24 = load i64, i64* %4
%25 = sub nsw i64 %24, 4
%26 = icmp sge i64 %23, %25
br i1 %26, label %27, label %34
27: ; preds = %22
%28 = load i64, i64* %2
%29 = load i64, i64* %6
%30 = add nsw i64 %29, %28
store i64 %30, i64* %6
br label %31
31: ; preds = %27
%32 = load i64, i64* %2
%33 = sub nsw i64 %32, 2
store i64 %33, i64* %2
br label %22
34: ; preds = %22
%35 = load i64, i64* %6
%36 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %35)
br label %7
37: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %27
5: ; preds = %0, %5
%6 = load i64, i64* %1
%7 = add nsw i64 %6, 1
%8 = sdiv i64 %7, 2
%9 = shl nsw i64 %8, 1
%10 = mul i64 %9, %8
%11 = add i64 %10, -1
%12 = add i64 %10, -4
%13 = call i64 @llvm.smin.i64(i64 %11, i64 %12)
%14 = sub i64 %10, %13
%15 = lshr i64 %14, 1
%16 = add i64 %10, -3
%17 = mul i64 %15, %16
%18 = lshr i64 %14, 1
%19 = add nsw i64 %15, -1
%20 = mul i64 %18, %19
%21 = and i64 %20, -2
%22 = add i64 %11, %17
%23 = sub i64 %22, %21
%24 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %23)
%25 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%26 = icmp eq i32 %25, 1
br i1 %26, label %5, label %27
27: ; preds = %5, %0
ret i32 0
}