#include <stdio.h> int main() { int N; while(scanf("%d", &N) != EOF) { printf("%d\n", (2+(2+3*(N-1)))*N/2); } return 0; }