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