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