package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var out = bufio.NewWriter(os.Stdout) func F(x int) int { if x == 1 { return 0 } // x >= 2 if x%2 == 0 { d := Max(Ceil(x, 2)-2, 0) return x + 8*d } else { return F(x+1) + 1 } } func main() { buf := make([]byte, 1024*1024) sc.Buffer(buf, bufio.MaxScanTokenSize) sc.Split(bufio.ScanWords) x := nextInt() ans := F(x) PrintInt(ans) } func nextInt() int { sc.Scan() i, _ := strconv.Atoi(sc.Text()) return i } func PrintInt(x int) { defer out.Flush() fmt.Fprintln(out, x) } func Max(x, y int) int { if x < y { return y } return x } func Ceil(x, y int) int { return (x + y - 1) / y }