import std.algorithm;
import std.stdio;
import std.conv;
import std.string;
int main() {
char[] arr;
readln(arr);
writeln(map!"a * a + a + 1"(to!(double[])(split(arr))));
return 0;
}
aW1wb3J0IHN0ZC5hbGdvcml0aG07CmltcG9ydCBzdGQuc3RkaW87CmltcG9ydCBzdGQuY29udjsKaW1wb3J0IHN0ZC5zdHJpbmc7CgppbnQgbWFpbigpIHsKICAgIGNoYXJbXSBhcnI7CiAgICAKICAgIHJlYWRsbihhcnIpOyAgICAKICAgIHdyaXRlbG4obWFwISJhICogYSArIGEgKyAxIih0byEoZG91YmxlW10pKHNwbGl0KGFycikpKSk7CiAgICAKICAgIHJldHVybiAwOwp9