#include<stdio.h>
main()
{
	int a,b,i,s=0;
	for(i=0;i<100;i++)
	{a=i/10;
		b=i%10;
		if(i%2==0 && (a==4 || b==4))
		s=s+i;		
	}
	printf("%d",s);
 }