#include <iostream>using namespace std;
int main (){ int h; cin >> h; cout << (h+24 - 15) % 24 << endl; return 0;}