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