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 <assert.h>
#include <stdlib.h>
#include <string.h>

//#define NDEBUG

#ifdef NDEBUG
#define DEBUG_PRINT(fmt, ...) ((void)0)
#else
#define DEBUG_PRINT(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
#endif
#define ASSERT_RANGE(min,x,max) assert(((x)>=(min)) && ((x)<=(max)))


#define N_MIN 1
#define N_MAX 100000

#define X_MIN 0
#define X_MAX 100000

#define T_MIN 1
#define T_MAX 100000
int sort_int(int *a, int N) {// {{{
	int i;
	for (i = 0; i < N-1; i++) {
		int j;
		for (j = i + 1; j < N; j++) {
			if (a[i] > a[j]) {
				int tmp = a[i];
				a[i] = a[j];
				a[j] = tmp;
			}
		}
	}
	return 0;
}// }}}

int main(int argc, char **argv) {
	char s[4];
	fscanf(stdin,"%s",s);
	if (strcmp(s,"SUN") == 0) {
		fprintf(stdout,"7\n");
		return 0;
	}
	if (strcmp(s,"MON") == 0) {
		fprintf(stdout,"6\n");
		return 0;
	}
	if (strcmp(s,"TUE") == 0) {
		fprintf(stdout,"5\n");
		return 0;
	}
	if (strcmp(s,"WED") == 0) {
		fprintf(stdout,"4\n");
		return 0;
	}
	if (strcmp(s,"THU") == 0) {
		fprintf(stdout,"3\n");
		return 0;
	}
	if (strcmp(s,"FRI") == 0) {
		fprintf(stdout,"2\n");
		return 0;
	}
	if (strcmp(s,"SAT") == 0) {
		fprintf(stdout,"1\n");
		return 0;
	}
	assert(0);
	return 0;
}