#include<bits/stdc++.h>
using namespace std;
int a,b,c,n;
const int mod = 999983;
void solve(){
cin>>n;
a = 1,b = 1,c = 1;
for(int i = 2;i<=n;i++){
c = (a + b)%mod;
a = b;
b = c;
}
cout<<c;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}