def main(): K = int(input()) print((1+(K*2))**2-(4*K-1)) if __name__ == '__main__': main()