Problem:
Score : 100 points

Problem Statement

Given is a string S representing the day of the week today.

S is SUN, MON, TUE, WED, THU, FRI, or SAT, for Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday, respectively.

After how many days is the next Sunday (tomorrow or later)?

Constraints

S is SUN, MON, TUE, WED, THU, FRI, or SAT.

Input

Input is given from Standard Input in the following format:

S

Output

Print the number of days before the next Sunday.

Sample Input 1

SAT

Sample Output 1

1

It is Saturday today, and tomorrow will be Sunday.

Sample Input 2

SUN

Sample Output 2

7

It is Sunday today, and seven days later, it will be Sunday again.

Solution in C (GCC 5.4.1) (judge verdict: Accepted)

#include <stdio.h>
#include <string.h>
int main(void)
{
 int i;
 char S[7][3];
 S[0][0] = 'M';S[0][1] = 'O';S[0][2] = 'N';
 S[1][0] = 'T';S[1][1] = 'U';S[1][2] = 'E';
 S[2][0] = 'W';S[2][1] = 'E';S[2][2] = 'D';
 S[3][0] = 'T';S[3][1] = 'H';S[3][2] = 'U';
 S[4][0] = 'F';S[4][1] = 'R';S[4][2] = 'I';
 S[5][0] = 'S';S[5][1] = 'A';S[5][2] = 'T';
 S[6][0] = 'S';S[6][1] = 'U';S[6][2] = 'N';

/*
 for(i=0;i<7;i++)
  printf("%c%c%c\n",S[i][0],S[i][1],S[i][2]);
*/

 char Sa[3];
 scanf("%s",Sa);
 if (strcmp(Sa,"SUN")==0) 
  {
  printf("7\n");
  return 0;
  }
 for(i=0;i<7;i++)
  if((S[i][0]==Sa[0])&&(S[i][1]==Sa[1])&&(S[i][2]==Sa[2])) printf("%d\n",(7-i-1)%7);

 return 0;
}