#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 /*<<< orphan*/ scanf(char *, long long *, long long *);
int main() {
  long long int a, b, op;
  scanf("%lld%lld", &a, &b);
  if (a % 2 != 0) {
    op = (a / 2) * 10 + 2 * (b - 1);
  } else if (a % 2 == 0) {
    op = (((a - 1) / 2) * 10) + 1 + 2 * (b - 1);
  }
  printf("%lld", op);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1185 <main+0x65>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
imul   $0xa,%rax,%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    11cf <main+0xaf>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    11ca <main+0xaa>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
imul   $0xa,%rax,%rax
add    $0x1,%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    11cf <main+0xaf>
mov    -0x20(%rbp),%rsi
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x10(%rsp),%rax
test   $0x1,%al
jne    116b <main+0x4b>
lea    -0x1(%rax),%rcx
shr    $0x3f,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
sar    %rax
lea    (%rax,%rax,4),%rax
mov    0x8(%rsp),%rcx
add    %rcx,%rcx
lea    (%rcx,%rax,2),%rsi
add    $0xffffffffffffffff,%rsi
jmp    118c <main+0x6c>
mov    %rax,%rcx
shr    $0x3f,%rcx
add    %rax,%rcx
sar    %rcx
lea    (%rcx,%rcx,4),%rax
mov    0x8(%rsp),%rcx
add    %rcx,%rcx
lea    (%rcx,%rax,2),%rsi
add    $0xfffffffffffffffe,%rsi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

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