#!/bin/python import sys n = int(raw_input().strip()) # your code goes here for i in range(1, n): for j in range(1, n): dist = [[-1 for _ in range(n)] for _ in range(n)] dist[0][0] = 0 q = [(0,0)] while q != []: x,y = q.pop(0) for a in (i, -i): for b in (j, -j): if 0 <= x+a < n and 0 <= y+b < n and dist[x+a][y+b] == -1: dist[x+a][y+b] = dist[x][y] + 1 q.append((x+a,y+b)) if 0 <= x+b < n and 0 <= y+a < n and dist[x+b][y+a] == -1: dist[x+b][y+a] = dist[x][y] + 1 q.append((x+b, y+a)) print dist[n-1][n-1], print