#include <iostream>
using namespace std;
int main(){ int a; while(cin >> a){ cout << a*a-a+2 << endl; } return 0;}