#include <iostream>
#include <cmath>
#include <algorithm>
int main() {
while (1) {
int x = 0;
std::cin >> x;
std::cout << pow((5*x), 2) - 9 * x - 2 << std::endl << std::endl;
}
#include <iostream>
#include <cmath>
#include <algorithm>
int main() {
while (1) {
int x = 0;
std::cin >> x;
std::cout << pow((5*x), 2) - 9 * x - 2 << std::endl << std::endl;
}
}