#include<stdio.h>
int main()
{
    int a,b,c,x,y,z,t;
    scanf("%d%d%d%d%d%d",&a,&b,&c,&x,&y,&z);
    if(a<=0||b<=0||c<=0||x<=0||y<=0||=z<0)
    {
        printf("Invalid input");
    }
    else
    {
    //A=a*x;
    //B=b*y;
    //C=c*z;
    t=(a*x)+(b*y)+(c*z);
    printf("%d",t);
    }
    return 0;
}