package main
 
import (
    "bufio"
    "fmt"
    "os"
)

func main() {
    
    input := bufio.NewScanner(os.Stdin)
    input.Scan()
    inputs := input.Text()
    
    word := 0
    num := 0
    space := 0
    other := 0
    for _, v := range inputs {
        if v >= 'a' && v <= 'z' || v >= 'A' && v <= 'Z' {
            word++
        } else if v >= 48 && v <= 57 {
            num++
        } else if v == ' ' {
            space++
        } else {
            other++
        }
    }
    
    fmt.Println(word)
    fmt.Println(space)
    fmt.Println(num)
    fmt.Println(other)
    
}