#!/bin/python3 import sys def sumOfGroup(k): a = [i for i in range(1, pow(10,6), 2)] b = [int((i) * (i+1) / 2) for i in range(0, 1000)] c = [a[b[i]:b[i+1]] for i in range(0, 100)] return sum(c[k-1]) if __name__ == "__main__": k = int(input().strip()) answer = sumOfGroup(k) print(answer)