#include
#include
template
T NOD(T var1, T var2)
{
while(var1 != var2)
{
if(var1 > var2)
var1 = var1 - var2;
else var2 = var2 - var1;
}
return var1;
}
int main()
{
int
z, x, a, d;
size_t number(0);
std::cin >> z >> a >> d;
x = z > 0 ? -3*z : pow(z, 2);
for(int i = 1; i < x; i++)
{
if(NOD(i, x) == 1)
number++;
}
std::cout << 2 * number * static_cast<int>(a * sin(x) + d * exp(-(x+3))) << std::endl;</p>
}