#include<bits/stdc++.h>
using namespace std;
int a,b;
int main(){
	scanf("%d %d",&a,&b);
	printf("%d",(b-a)*30);
	return 0;
}

/**************************************************************
	Problem: 1320
	User: zhangziang
	Language: C++
	Result: Accepted
	Time:9 ms
	Memory:2072 kb
****************************************************************/