package main import . "fmt" func main() { var n,k,q int Scan(&n,&k,&q) m:=map[string]int{} var c,u int for ;q>0;q-- { var x int Scan(&x) if x==1 { var s string Scan(&s) m[s]=c c++ continue } var e int for i:=0;i<6;i++ { var t string var d int Scan(&t,&d) if w,ok:=m[t];ok&&c-w<=n&&k60 { continue } m[t]=c c++ u++ } } Println(u) }