package main import ( "fmt" ) func main() { var N, M int fmt.Scan(&N, &M) p := make([]int, 1+N) for i := 0; i < M; i++ { var A, B int fmt.Scan(&A, &B) p[B]++ } m := 0 for b := 1; b <= N; b++ { if p[b] == 0 { m++ } } fmt.Println(m) }