import strutils let n: int = stdin.readline.parseInt s: string = stdin.readline var u, m, g: seq[int] ans: int = 0 for i in 0..