using System;
public class Program
{
public static void Main()
double a = Convert.ToDouble(Console.ReadLine());
double b = Convert.ToDouble(Console.ReadLine());
double c;
c = Math.Pow(a , Math.Sin(a)) + Math.Pow(b, Math.Cos(b)) + Math.Pow((a - b), 2) - Math.Sqrt(Math.Pow((a + b), 2)) + Math.Pow(a, 2) + Math.Pow(b , 2);
Console.WriteLine(c);
}