#include<bits/stdc++.h>
using namespace std;
int main(){
	int m,n;
	cin>>m>>n;
	cout<<(n-m)*30;
	
}
/**************************************************************
	Problem: 1320
	User: baizhoudeyueguang
	Language: C++
	Result: Accepted
	Time:8 ms
	Memory:2072 kb
****************************************************************/