/*
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
*/
/*
#include <stdio.h>
#include <string.h>
int main()
{
char str[101];
int i;
gets(str);
for(i=0;str[i]!=NULL;i++)
{
if(str[i]!=' ')
{
printf("%c",str[i]);
}
}
return 0;
}
#include <stdio.h>
#include <string.h>
int main()
{
char str[100001];
int a=0,b=0,i;
scanf("%s",str);
for(i=0;str[i]!=0;i++)
{
if(str[i]=='(')
{
a++;
}
else if(str[i]==')')
{
b++;
}
}
printf("%d %d",a,b);
}
아스키코드
'a' 97
'A' 65
' ' 32
NULL 0
'0' 48 문자숫자
'1' 49
'5' 53
' '-48
*/
/*
#include <stdio.h>
#include <string.h>
int main()
{
char s[1001];
int i;
scanf("%s",s);
for(i=0;s[i]!=NULL;i++)
{
if('A'<=s[i] && s[i]<='Z')
{
printf("%c",s[i]+32);
}
else if('a'<=s[i] && s[i]<='z')
{
printf("%c",s[i]-32);
}
else
{
printf("%c",s[i]);
}
}
return 0;
}
*/
/*
#include <stdio.h>
#include <string.h>
int main()
{
char s[21];
int a,b,i;
scanf("%s",s);
for(i=0;s[i]!=NULL;i++)
{
printf("%c",s[i]+2);
}
printf("\n");
for(i=0;s[i]!=NULL;i++)
{
printf("%c",s[i]*7%80+48);
}
return 0;
}
100
1000
10000
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
*/
// 어떤 수가 3의 배수다 == 그 수의 각 자릿수의 합이 3의 배수다
//1123487864654856765132
//'3'==51
#include <stdio.h>
#include <string.h>
int main()
{
char s[501];
scanf("%s",s);
int i,n=0;
for(i=0;str[i]!=NULL;i++)
{
n=n+str[i]-48;
}
if(n%3==0)
{
printf("1");
}
else
{
printf("0");
}
return 0;
}