ll@(N,M,K);VI n(N),o(N);rep(M){ll@A,@B;n[--A]++,o[--B]++;}wt(sum[i,0,N](n[i]?max(0,K-e[i]):0));