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()
{
    char D1[4] ="SUN";
    char D2[4] ="MON";
    char D3[4] ="TUE";
    char D4[4] ="WED";
    char D5[4] ="THU";
    char D6[4] ="FRI";
    char D7[4] ="SAT";
    int Check=0;

    char S[4];
    scanf("%[^\n]", &S);
    for( int i=0; i<4; i++){
        if(S[i]!=D1[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("7");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D2[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("6");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D3[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("5");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D4[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("4");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D5[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("3");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D6[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("2");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D7[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("1");
            }
            
        }
    }
}