#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 long);
int scanf(char *, long long *);
int main() {
  long long int n, ans, x;
  while (scanf("%lld", &n) != -1) {
    printf("%lld\n", (n / 9) * 81 + (n % 9) * (n % 9));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
je     1199 <main+0x79>
mov    -0x10(%rbp),%rax
mov    $0x9,%ecx
cqto
idiv   %rcx
imul   $0x51,%rax,%rsi
mov    -0x10(%rbp),%rax
mov    $0x9,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x9,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    -0x28(%rbp),%rdx
imul   %rax,%rdx
add    %rdx,%rsi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
je     119e <main+0x7e>
movabs $0x1c71c71c71c71c72,%r12
c7 71 1c
lea    0xeb8(%rip),%r14
lea    0xeac(%rip),%r15
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%rsi
mov    %rsi,%rax
imul   %r12
mov    %rdx,%rax
shr    $0x3f,%rax
add    %rdx,%rax
lea    (%rax,%rax,8),%rax
lea    (%rax,%rax,8),%rcx
sub    %rax,%rsi
imul   %rsi,%rsi
add    %rcx,%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [6 x i8] c"%lld\0A\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 = icmp eq i32 %3, -1
br i1 %4, label %15, label %5
5: ; preds = %0, %5
%6 = load i64, i64* %1
%7 = sdiv i64 %6, 9
%8 = mul nsw i64 %7, 81
%9 = srem i64 %6, 9
%10 = mul nsw i64 %9, %9
%11 = add nsw i64 %8, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %11)
%13 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %5
15: ; preds = %5, %0
ret i32 0
}