#include<iostream>
using namespace std;
int main()
{
int h;
cin>>h;
cout<<(h-15+24)%24<<endl;//%=求h-15+24除24的"餘數"
}