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