#include<bits/stdc++.h>
using namespace std;
int main(){
	int m,n,a;
	scanf("%d %d",&m,&n);
	a=(n-m)*30;
	printf("%d",a);
}
/**************************************************************
	Problem: 1320
	User: toughuatao1
	Language: C++
	Result: Accepted
	Time:8 ms
	Memory:2072 kb
****************************************************************/