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