← Home
```go
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]byte, 1024*1024), 1024*1024)

	chatSize := 0
	totalTraffic := 0

	for scanner.Scan() {
		line := scanner.Text()
		if len(line) == 0 {
			continue
		}
		if line[0] == '+' {
			chatSize++
		} else if line[0] == '-' {
			chatSize--
		} else {
			// Send command: <sender_name>:<message_text>
			idx := strings.Index(line, ":")
			if idx >= 0 {
				message := line[idx+1:]
				totalTraffic += len(message) * chatSize
			}
		}
	}

	fmt.Println(totalTraffic)
}
```