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 Go (1.6) (judge verdict: Wrong Answer)

package main

import (
    "bufio"
    "log"
    "math"
    "os"
    "strconv"
    "fmt"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
    sc.Split(bufio.ScanWords)
    log.SetFlags(log.Lshortfile)
    s := nextString()
    var ans int = -1
    switch s{
    case "SUN":
        ans = 0
    case "MON":
        ans = 6
    case "TUE":
        ans = 5
    case "WED":
        ans = 4
    case "THU":
        ans = 3
    case "FRI":
        ans = 2
    case "SAT":
        ans = 1
    }
    fmt.Println(ans)
}

func nextString() string {
    sc.Scan()
    return sc.Text()
}

func nextInt() int {
    sc.Scan()
    i, err := strconv.Atoi(sc.Text())
    if err != nil {
        panic(err)
    }
    return i
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt32

func pow(a, b int) int {
    return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
    return a * b / gcd(a, b)
}
func gcd(a, b int) int {
    if a < b {
        a, b = b, a
    }
    for b != 0 {
        a, b = b, a%b
    }
    return a
}
func max(a ...int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r < a[i] {
            r = a[i]
        }
    }
    return r
}
func min(a ...int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r > a[i] {
            r = a[i]
        }
    }
    return r
}
func sum(a []int) (r int) {
    for i := range a {
        r += a[i]
    }
    return r
}
func abs(a int) int {
    if a < 0 {
        return -a
    }
    return a
}

type pair struct {
    a, b int
}

type pairs []pair

func (p pairs) Len() int {
    return len(p)
}
func (p pairs) Swap(i, j int) {
    p[i], p[j] = p[j], p[i]
}

func (p pairs) Less(i, j int) bool {
    if p[i].a == p[j].a {
        return p[i].b < p[j].b
    }
    return p[i].a < p[j].a
}