#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int year = (n-1)/366+1;
    cout<<setfill('0)<<setw(4)<<year<<endl;
    return 0;
}