#include <cstdio>

using namespace std;

int main()
{
    int a,b,c,d,e;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    e=a*d+c*b;
    printf("%d",e);
}