CodeEff/ECCO huggingface dataset:
# Original solution
x = input().split(' ')
a = int(x[0])
b = int(x[1])
c = int(x[2])

if a < b < c:
    print('Yes')
else:
    print('No')

# Optimized solution
(a, b, c) = input().rstrip().split()
a = int(a)
b = int(b)
c = int(c)

if a < b < c:
    print('Yes')
else:
    print('No')
# Original solution
(a, b, c) = input().rstrip().split()
a = int(a)
b = int(b)
c = int(c)

if a < b < c:
    print('Yes')
else:
    print('No')

# Optimized solution
a, b, c = [int(i) for i in input().split()]

if a < b < c:
    print("Yes")

else:
    print("No")
# Original solution
a,b,c=list(map(int,input().split()));print('Yes' if a<b<c else 'No')

# Optimized solution
m,n,o=list(map(int,input().split()))
print('Yes'if m<n<o else'No')
# Original solution
a,b,c=list(map(int,input().split()))
if a < b and b < c:
    print("Yes")
else:
    print("No")

# Optimized solution
a,b,c=list(map(int,input().split()))
if a < b < c:
    print("Yes")
else:
    print("No")
# Original solution
a,b,c=(int(i) for i in input().split())

if a<b<c:
  print("Yes")
else:
  print("No")

# Optimized solution
a,b,c=list(map(int,input().split()))

if a<b<c:
  print("Yes")

else:
  print("No")
# Original solution
#coding:UTF-8
import copy

n = list(map(int,input().split()))

if n[0]<n[1]<n[2]:
    print("Yes")
else:
    print("No")

# Optimized solution
#coding:UTF-8

n = list(map(int,input().split()))

if n[0]<n[1]<n[2]:
    print("Yes")
else:
    print("No")
# Original solution
nums = input().split()
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])

if a < b < c:
    print('Yes')
else:
    print('No')

# Optimized solution
a, b, c = list(map(int, input().split()))
if a < b < c:
    print("Yes")
else:
    print("No")
# Original solution
import sys

if __name__ == '__main__':
    import doctest
    doctest.testmod()
    a, b, c = list(map(int, sys.stdin.read().split()))
    if a < b < c:
        print("Yes")
    else:
        print("No")


# Optimized solution
#!/usr/bin/env python
#-*- coding: utf-8 -*-

# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_B

if __name__ == '__main__':
    a, b, c = list(map(int, input().split()))
    if a < b < c:
        print("Yes")
    else:
        print("No")
# Original solution
def par(a):
    L = []
    while P[a] != a:
        L.append(a)
        a = P[a]
    for l in L:
        P[l] = a
    return a
def unite(a, b):
    pa = par(a)
    pb = par(b)
    if pa == pb: return
    if LEN[pa] < LEN[pb]:
        a, b, pa, pb = b, a, pb, pa
    P[pb] = pa
    if LEN[pa] == LEN[pb]: LEN[pa] += 1
    CNT[pa] += CNT[pb]
def cnt(a):
    return CNT[par(a)]

N = int(eval(input()))
P = [i for i in range(N)]
LEN = [1] * N
CNT = [1] * N
FULL = [0] * N
A = [int(a) - 1 for a in input().split()]
for i, a in enumerate(A):
    if a < 0: continue
    if par(i) != par(a):
        unite(i, a)
    else:
        FULL[i] = 1
for i in range(N):
    if FULL[i]:
        FULL[par(i)] = 1
X = []
Y = []
for i in range(N):
    if par(i) == i:
        if FULL[i] == 0:
            X.append(CNT[i])
        else:
            Y.append(CNT[i])
M = len(X)
mod = 10 ** 9 + 7
K = 96
m = int(("1" * 32 + "0" * 64) * 5050, 2)
pa = (1 << 64) - ((1 << 64) % mod)
modP = lambda x: x - ((x & m) >> 64) * pa
ans = (sum(X) + sum(Y) - len(Y)) * pow(N - 1, M, mod) % mod
x = 1
for i, a in enumerate(X):
    x *= (a << K) + 1
    x = modP(x)

sx = bin(x)[2:] + "_"
L = [int(sx[-(i+1) * K - 1:-i * K - 1], 2) % mod for i in range((len(sx)+K-2) // K)]
fa = 1
ans = (ans + M * pow(N - 1, M - 1, mod)) % mod
for i, l in enumerate(L):
    if i == 0: continue
    ans = (ans - l * fa * pow(N - 1, M - i, mod)) % mod
    fa = fa * i % mod
print(ans)

# Optimized solution
def par(a):
    L = []
    while P[a] != a:
        L.append(a)
        a = P[a]
    for l in L:
        P[l] = a
    return a
def unite(a, b):
    pa = par(a)
    pb = par(b)
    if pa == pb: return
    if LEN[pa] < LEN[pb]:
        a, b, pa, pb = b, a, pb, pa
    P[pb] = pa
    if LEN[pa] == LEN[pb]: LEN[pa] += 1
    CNT[pa] += CNT[pb]
def cnt(a):
    return CNT[par(a)]

N = int(eval(input()))
P = [i for i in range(N)]
LEN = [1] * N
CNT = [1] * N
FULL = [0] * N
A = [int(a) - 1 for a in input().split()]
for i, a in enumerate(A):
    if a < 0: continue
    if par(i) != par(a):
        unite(i, a)
    else:
        FULL[i] = 1
for i in range(N):
    if FULL[i]:
        FULL[par(i)] = 1
X = []
Y = []
for i in range(N):
    if par(i) == i:
        if FULL[i] == 0:
            X.append(CNT[i])
        else:
            Y.append(CNT[i])
M = len(X)
mod = 10 ** 9 + 7
K = 96
m = int(("1" * 32 + "0" * 64) * 5050, 2)
pa = (1 << 64) - ((1 << 64) % mod)
modP = lambda x: x - ((x & m) >> 64) * pa
ans = (sum(X) + sum(Y) - len(Y)) * pow(N - 1, M, mod) % mod
x = 1
for i, a in enumerate(X):
    x *= (a << K) + 1
    x = modP(x)

sx = bin(x)[2:] + "_"
L = [int(sx[-(i+1) * K - 1:-i * K - 1], 2) % mod for i in range((len(sx)+K-2) // K)]
if M:
    fa = 1
    ans = (ans + M * pow(N - 1, M - 1, mod)) % mod
    for i, l in enumerate(L):
        if i == 0: continue
        ans = (ans - l * fa * pow(N - 1, M - i, mod)) % mod
        fa = fa * i % mod
print(ans)
# Original solution
# AGC002B - Box and Ball
def main():
    N, M = tuple(map(int, input().split()))
    X = tuple(tuple(map(int, input().split())) for _ in range(M))
    R = [0] * (N + 1)  # red ball may be in box i
    R[1] = 1
    C = [1] * (N + 1)  # number of balls in box i (count)
    for x, y in X:
        if R[x]:
            R[y] = 1
        C[x] -= 1
        C[y] += 1
        if C[x] == 0:
            R[x] = 0
    ans = sum(R[1:])
    print(ans)


if __name__ == "__main__":
    main()

# Optimized solution
# AGC002B - Box and Ball
import sys
input = sys.stdin.readline

def main():
    N, M = tuple(map(int, input().split()))
    X = tuple(tuple(map(int, input().split())) for _ in range(M))
    R = [0] * (N + 1)  # red ball may be in box i
    R[1] = 1
    C = [1] * (N + 1)  # number of balls in box i (count)
    for x, y in X:
        if R[x]:
            R[y] = 1
        C[x] -= 1
        C[y] += 1
        if C[x] == 0:
            R[x] = 0
    ans = sum(R[1:])
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    N,M=list(map(int,readline().split()))
    x=[0]*M
    y=[0]*M
    for i in range(M):
        a,b=list(map(int,readline().split()))
        x[i]=a
        y[i]=b

    li=[[1,0] for _ in range(N+1)]
    li[1][1]=1
    for i in range(M):
        if li[x[i]][0]>=2 and li[x[i]][1]==1:
            li[y[i]][0]+=1
            li[y[i]][1]=1

            li[x[i]][0]-=1

        elif li[x[i]][0]==1 and li[x[i]][1]==1:
            li[y[i]][0]+=1
            li[y[i]][1]=1

            li[x[i]][0]-=1
            li[x[i]][1]=0

        else:
            li[y[i]][0]+=1

            li[x[i]][0]-=1
            
    count=0
    for i in range(1,N+1):
        if li[i][1]==1: count+=1
    print(count)
if __name__=="__main__":
    main()

# Optimized solution
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    N,M=list(map(int,readline().split()))
    x=[0]*M
    y=[0]*M
    for i in range(M):
        x[i],y[i]=list(map(int,readline().split()))

    box=[1]*(N+1)
    flags=[False]*(N+1)
    flags[1]=True

    for i in range(M):
        out=x[i]
        inn=y[i]
        if flags[out]==True and box[out]==1:
            flags[out]=False
            flags[inn]=True
        elif flags[out]==True:
            flags[inn]=True
        box[out]-=1
        box[inn]+=1

    res=0
    for i in range(N+1):
        if flags[i]==True:
            res+=1
    print(res)
        
if __name__=="__main__":
    main()
# Original solution
def main():
  n, m = input_list()
  box = [False]*n
  box[0] = True
  nums = [1]*n
  for i in range(m):
    x, y = input_list()
    if box[x-1]:
      box[y-1] = True
    nums[x-1] = nums[x-1] - 1
    nums[y-1] = nums[y-1] + 1
    if nums[x-1] == 0:
      box[x-1] = False
  print((box.count(True)))
    

def input_list():
  return list(map(int, input().split()))

import math
main()

# Optimized solution
# import sys
# input = sys.stdin.readline
import itertools


# 持っているビスケットを叩き、1枚増やす
# ビスケット A枚を 1円に交換する
# 1円をビスケット B枚に交換する
def main():
    n, m = input_list()
    balls = [1] * n
    reds = [False] * n
    reds[0] = True
    for _ in range(m):
        x, y = input_list()
        if reds[x-1]:
            reds[y-1] = True
        balls[x-1] -= 1
        balls[y-1] += 1
        if balls[x-1] == 0:
            reds[x-1] = False
    c = 0
    for v in reds:
        if v:
            c += 1
    print(c)


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()
# Original solution
#!/usr/bin/env python3
(n, m), *q = [[*list(map(int, i.split()))] for i in open(0)]
b = [1] + [0] * (n - 1)
c = [1] * n
for x, y in q:
    c[x - 1] -= 1
    c[y - 1] += 1
    b[y - 1] |= b[x - 1]
    b[x - 1] *= c[x - 1] > 0
print((sum(b)))


# Optimized solution
(n, m), *q = [[*list(map(int, i.split()))] for i in open(0)]
b = [0] * (n + 1)
b[1] = 1
c = [1] * (n + 1)
for x, y in q:
    c[x] -= 1
    c[y] += 1
    b[y] |= b[x]
    b[x] *= c[x] > 0
print((sum(b)))
# Original solution
n, m = list(map(int, input().split()))

moves = [list(map(int, input().split())) for i in range(m)]

possibilities = [False] * n
possibilities[0] = True
nums = [1] * n

for i in range(m):
    x = moves[i][0] - 1
    y = moves[i][1] - 1

    if possibilities[x]:
        possibilities[y] = True

    nums[x] -= 1
    nums[y] += 1
    if nums[x] == 0:
        possibilities[x] = False

ans = 0
for j in range(n):
    if possibilities[j] and (nums[j] > 0):
        ans += 1
print(ans)



# Optimized solution
n, m = list(map(int, input().split()))

moves = [list(map(int, input().split())) for i in range(m)]

possibilities = [False] * n
possibilities[0] = True
nums = [1] * n

for i in range(m):
    x = moves[i][0] - 1
    y = moves[i][1] - 1

    if possibilities[x]:
        possibilities[y] = True

    nums[x] -= 1
    nums[y] += 1
    if nums[x] == 0:
        possibilities[x] = False

print((sum(possibilities)))
# Original solution
n,m=list(map(int,input().split()))
cnt=[1]*n
s=set([1])
for i in range(m):
  x,y=list(map(int,input().split()))
  cnt[y-1]+=1
  cnt[x-1]-=1
  if x in s:
    s.add(y)
  if cnt[x-1]==0:
    if x in s:
      s.remove(x)
print((len(s)))

# Optimized solution
n,m=list(map(int,input().split()))
arr=[list(map(int,input().split())) for _ in range(m)]
count=[1]*(n+1)
s=set()
s.add(1)
for a,b in arr:
  count[b]+=1
  count[a]-=1
  if a in s:
    s.add(b)
  if count[a]==0:
    s.discard(a)
print((len(s)))
# Original solution
n,m=list(map(int,input().split()))
arr=[list(map(int,input().split())) for _ in range(m)]
count=[1]*(n+1)
s=set()
s.add(1)
for a,b in arr:
  count[b]+=1
  count[a]-=1
  if a in s:
    s.add(b)
  if count[a]==0:
    s.discard(a)
print((len(s)))

# Optimized solution
n,m=list(map(int,input().split()))
arr=[list(map(int,input().split())) for _ in range(m)]
count=[1]*(n+1)
flag=[False]*(n+1)
flag[1]=True
for a,b in arr:
  count[b]+=1
  count[a]-=1
  if flag[a]==True:
    flag[b]=True
  if count[a]==0:
    flag[a]=False
print((flag.count(True)))
# Original solution
n,m=list(map(int,input().split()))
cnt=[1]*n
res=[0]*n
res[0]=1
for i in range(m):
    x,y=list(map(int,input().split()))
    if res[x-1]==1:
        res[y-1]=1
        if cnt[x-1]==1:
            res[x-1]=0
    cnt[x-1]-=1
    cnt[y-1]+=1
print((sum(res)))

# Optimized solution
def main():
    n,m=list(map(int,input().split()))
    cnt=[1]*n
    res=[0]*n
    res[0]=1
    for i in range(m):
        x,y=list(map(int,input().split()))
        if res[x-1]==1:
            res[y-1]=1
            if cnt[x-1]==1:
                res[x-1]=0
        cnt[x-1]-=1
        cnt[y-1]+=1
    print((sum(res)))
if __name__=="__main__":
    main()
# Original solution
n,m=list(map(int,input().split()))
x=[0]*n
x[0]=1
y=[1]*n
for i in range(m):
  a,b=list(map(int,input().split()))
  if x[a-1]==1:x[b-1]=1
  y[a-1]-=1
  y[b-1]+=1
  if y[a-1]==0:x[a-1]=0
print((sum(x)))

# Optimized solution
n,m=list(map(int,input().split()))
ans=[False]*n
ans[0]=True
co=[1]*n
for i in range(m):
  x,y=list(map(int,input().split()))
  ans[y-1]|=ans[x-1]
  co[x-1]-=1
  co[y-1]+=1
  if co[x-1]==0:ans[x-1]=False
print((ans.count(True)))
# Original solution
N, M = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(M)]
red = [0] * (N+1) #赤になりうる場所を１とする
red[1] = 1
red[0] = ""
ball = [1] * (N+1) #個数
ball[0] = ""
for x, y in xy:
  ball[y] += 1
  ball[x] -= 1
  if red[x] == 1:
    red[y] = 1
    if ball[x] == 0: red[x] = 0
print((red.count(1)))

# Optimized solution
n,m = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(m)]

box = [1]*(n+1)
red = [0]*(n+1)
red[1] = 1
for x,y in xy:
    box[x] -= 1
    box[y] += 1
    if red[x] == 1: red[y] = 1
    if box[x] == 0: red[x] = 0
print((red.count(1)))
# Original solution
n,m = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(m)]

box = [1]*(n+1)
red = [0]*(n+1)
red[1] = 1
for x,y in xy:
    box[x] -= 1
    box[y] += 1
    if red[x] == 1: red[y] = 1
    if box[x] == 0: red[x] = 0
print((red.count(1)))

# Optimized solution
n,m = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(m)]

box = [1]*(n+1)
red = [0]*(n+1)
red[1] = 1
for x,y in xy:
    box[x] -= 1
    box[y] += 1
    if red[x]==1: red[y] = 1
    if box[x]==0: red[x] = 0
print((sum(red)))
# Original solution
n,m = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(m)]

box = [1] * (n+1)
red = [0] * (n+1)
red[1] = 1
for x,y in xy:
    box[x] -= 1
    box[y] += 1
    if red[x] == 1: red[y] = 1
    if box[x] == 0: red[x] = 0
print((red.count(1)))

# Optimized solution
n,m = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(m)]
red = [0] * (n+1)
red[1] = 1
ball = [1] * (n+1)
for x,y in xy:
    ball[x] -= 1
    ball[y] += 1
    if red[x] == 1:
        red[y] = 1
        if ball[x] == 0: red[x] = 0
print((sum(red)))
# Original solution
def myAnswer(N:int,M:int,X:list,Y:list) -> int:
   red = 0
   ans = {0}
   box = [1] * N
   for x,y in zip(X,Y):
      if(x-1 in ans):
         ans.add(y-1)
      box[x-1] -= 1
      box[y-1] += 1
      for i in list(ans):
         if(box[i] == 0):
            ans.remove(i)
   return len(ans)

def modelAnswer():
   return
def main():
   N,M = list(map(int,input().split()))
   X = []
   Y = []
   for _ in range(M):
      x,y=list(map(int,input().split()))
      X.append(x)
      Y.append(y)
   print((myAnswer(N,M,X,Y)))
if __name__ == '__main__':
   main()

# Optimized solution
'''
Accepted    　:No
difficult   　: 
ペナルティ　  　:5分
実際の回答時間  :分
WAの回数　     :回
合計時間　　  　:分
'''

def myAnswer(N:int,M:int,X:list,Y:list) -> int:
   ans = {0}
   box = [1] * N
   for x,y in zip(X,Y):
      if(x-1 in ans):
         if(box[x - 1]==1):
            ans.remove(x-1)
         ans.add(y-1)
      box[x-1] -= 1
      box[y-1] += 1
   return len(ans)

def modelAnswer():
   return
def main():
   N,M = list(map(int,input().split()))
   X = []
   Y = []
   for _ in range(M):
      x,y=list(map(int,input().split()))
      X.append(x)
      Y.append(y)
   print((myAnswer(N,M,X,Y)))
if __name__ == '__main__':
   main()
# Original solution
N, M = list(map(int, input().split()))

b = [1] * N
b[0] = -1
for i in range(M):
  x, y = list(map(int, input().split()))
  if b[x - 1] < 0:
    b[x - 1] += 1
    b[y - 1] = -(abs(b[y - 1]) + 1)
  else:
    b[x - 1] -= 1
    if b[y - 1] < 0:
      b[y - 1] -= 1
    else:
      b[y - 1] += 1
print((len([x for x in b if x < 0])))


# Optimized solution
N, M = list(map(int, input().split()))

b = [1] * N
b[0] = -1
for i in range(M):
    x, y = list(map(int, input().split()))
    if b[x - 1] < 0:
        b[x - 1] += 1
        if b[y - 1] >= 0:
            b[y - 1] = -(b[y - 1] + 1)
        else:
            b[y - 1] -= 1
    else:
        b[x - 1] -= 1
        if b[y - 1] >= 0:
            b[y - 1] += 1
        else:
            b[y - 1] -= 1
print((len([x for x in b if x < 0])))
# Original solution
n, m = (int(x) for x in input().split())
ab = []
for _ in range(m):
    a, b = (int(x) for x in input().split())
    ab.append([a-1, b-1])

box = [1]*n

red = [0]*n

red[0] = 1

for x,y in ab:
    if 0 < red[x]:
        red[y] = 1
    box[x] -= 1
    box[y] += 1

    if box[x] == 0:
        red[x] = 0
print((sum(red)))

# Optimized solution
N,M = list(map(int,input().split()))

XY = [list(map(int,input().split())) for _ in range(M)]

ball_count = [1]*N

red_ball_cand = [0]*N
red_ball_cand[0] = 1

for i in range(M):
    x,y = XY[i]
    x,y = x-1,y-1
    if 0 < red_ball_cand[x]:
        red_ball_cand[y] = 1
        
    ball_count[x] -= 1
    ball_count[y] += 1
    
    if ball_count[x] == 0:
        red_ball_cand[x] = 0
print((sum(red_ball_cand)))
# Original solution
n,m = list(map(int, input().split()))

d = dict()
for i in range(1,n+1):
    d[str(i)] = 1

from collections import deque
ans = deque('1')
for _ in range(m):
    x,y = input().split()
    d[x] -= 1
    d[y] += 1
    if x in ans and y not in ans:
        ans.append(y)
    if d[x] == 0 and x in ans:
        ans.remove(x)
print((len(ans)))


# Optimized solution
n,m = list(map(int, input().split()))

'''
d = dict()
for i in range(1,n+1):
    d[str(i)] = 1
from collections import deque
ans = deque('1')'''
box = [1 for i in range(n)]
ans = [0 for i in range(n)]
ans[0] = 1
for _ in range(m):
    x,y = list(map(int,input().split()))
    box[x-1] -= 1
    box[y-1] += 1
    if ans[x-1]==1 and ans[y-1]==0:
        ans[y-1] = 1
    if box[x-1]==0 and ans[x-1]==1:
        ans[x-1] = 0
print((sum(ans)))
# Original solution
N,M = list(map(int,input().split()))
dp = [1 for i in range(N)]
trace = [0 for i in range(N)]
trace[0] = 1
for i in range(M):
    x,y = list(map(int,input().split()))
    dp[y-1] += 1
    dp[x-1] -= 1
    if trace[x-1] >= 1:
        trace[y-1] = max(trace[y-1]+1,0)
    if dp[x-1] == 0:
        trace[x-1] = 0

print((len(trace) - trace.count(0)))



# Optimized solution
N,M = list(map(int,input().split()))
dp = [1 for i in range(N)]
trace = [0 for i in range(N)]
trace[0] = 1
for i in range(M):
    x,y = list(map(int,input().split()))
    dp[y-1] += 1
    dp[x-1] -= 1
    if trace[x-1] >= 1:
        trace[y-1] = trace[x-1]
    if dp[x-1] == 0:
        trace[x-1] = 0

print((len(trace) - trace.count(0)))
# Original solution
N,M = list(map(int, input().split()))

ans = set([0])
cnt = [1] * N
for _ in range(M):
    x,y = [int(i) - 1 for i in input().split()]
    cnt[x] -= 1
    cnt[y] += 1

    if x in ans:
        if cnt[x] == 0:
            ans.remove(x)
        ans.add(y)

print((len(ans)))

# Optimized solution
N,M = list(map(int, input().split()))

ans = set([0])
cnt = [1] * N
for _ in range(M):
    x,y = [int(i) - 1 for i in input().split()]
    cnt[x] -= 1; cnt[y] += 1
 
    if x in ans:
        ans.add(y)
        if cnt[x] == 0: # 絶対に赤いボールがyに移される
            ans.remove(x)
 
print((len(ans)))
# Original solution
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():

    return

#B
def B():
    n,m = LI()
    f = [1]*n
    l = [0]*n
    l[0] = 1
    for i in range(m):
        x,y = LI()
        x -= 1
        y -= 1
        if l[x]:
            l[y] = 1
        f[x] -= 1
        f[y] += 1
        if f[x] == 0:
            l[x] = 0
    ans = 0
    for i in range(n):
        if l[i]:
            ans += 1
    print(ans)
    return

#C
def C():

    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

#Solve
if __name__ == "__main__":
    B()


# Optimized solution
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,m = LI()
    s = [1]*n
    f = [0]*n
    f[0] = 1
    for _ in range(m):
        a,b = LI()
        a -= 1
        b -= 1
        s[a] -= 1
        s[b] += 1
        if f[a]:
            f[b] = 1
            if s[a] == 0:
                f[a] = 0
    print((sum(f)))
    return

#Solve
if __name__ == "__main__":
    solve()
# Original solution
N, M = list(map(int, input().split()))
A = [1 for k in range(N)]
B = [0 for k in range(N)]

ans = 0
B[0] = 1
for k in range(M):
    x, y = list(map(int, input().split()))
    x -= 1
    y -= 1
    if B[x] == 1 and A[x] >= 2:
        A[x] -= 1
        A[y] += 1
        B[y] = 1
    elif B[x] == 1 and A[x] == 1:
        A[x] -= 1
        A[y] += 1
        B[x] = 0
        B[y] = 1
    else:
        A[x] -= 1
        A[y] += 1

print((B.count(1)))

# Optimized solution
N, M = list(map(int,input().split()))
B = [list(map(int,input().split())) for k in range(M)]
H = [1]*N
E = [0]*N
E[0] = 1
for e in B:
    x, y = e[0]-1, e[1]-1
    if E[x] == 1:
        if H[x] == 1:
            E[x] = 0
            E[y] = 1
        else:
            E[y] = 1
    H[x] -= 1
    H[y] += 1
print((E.count(1)))
# Original solution
# coding: utf-8
# Your code here!s = input()
n, m = list(map(int, input().split()))
x = []
y = []
for i in range(m):
    xi, yi = list(map(int, input().split()))
    x.append(xi)
    y.append(yi)
boxes = [False]*n
boxes[0] = True
boxescnt = [1]*n
for i in range(m):
    if boxes[x[i]-1] == True:
        if boxescnt[x[i]-1] == 1:
            boxes[x[i]-1] = False
        boxes[y[i]-1] = True
    boxescnt[x[i]-1] -= 1
    boxescnt[y[i]-1] += 1
print((sum(boxes)))


# Optimized solution
n, m = list(map(int, input().split()))
x = []
y = []
for i in range(m):
    xi, yi = list(map(int, input().split()))
    x.append(xi)
    y.append(yi)
num = [1]*n
able = [False]*n
able[0] = True
for i in range(m):
    if able[x[i]-1] == True:
        able[y[i]-1] = True
    num[x[i]-1] -= 1
    num[y[i]-1] += 1
    if num[x[i]-1] == 0:
        able[x[i]-1] = False
print((sum(able)))