1 #include<iostream>
2 #include<cstdio>
3 #include<cmath>
4 using namespace std;
5 char b[10001];
6 int ans;
7 string a;
8 int now=1;
9 int main()
10 {
11 cin>>a;
12 a=a+a;
13 int l=a.length();
14 for(int i=0;i<a.length();i++)
15 {
16 b[i]=a[i]-48;
17 }
18
19 for(int i=a.length()-1;i>=0;i--)
20 {
21 ans=b[i]*now+ans;
22 now=now*10;
23 }
24 cout<<ans/7/11/13;
25 return 0;
26 }