1 #include <algorithm>
2 #include <cstdio>
3
4 using namespace std;
5
6 const int N(10000+5);
7 const int M(30000+5);
8 int head[N],sumedge;
9 struct Edge
10 {
11 int v,next;
12 Edge(int v=0,int next=0):v(v),next(next){}
13 }edge[M];
14 inline void ins(int u,int v)
15 {
16 edge[++sumedge]=Edge(v,head[u]);
17 head[u]=sumedge;
18 }
19
20 int tim,dfn[N],low[N];
21 int top,Stack[N],instack[N];
22 int sumcol,col[N],point[N];
23 void DFS(int now)
24 {
25 low[now]=dfn[now]=++tim;
26 Stack[++top]=now;instack[now]=1;
27 for(int v,i=head[now];i;i=edge[i].next)
28 {
29 v=edge[i].v;
30 if(!dfn[v]) DFS(v),low[now]=min(low[now],low[v]);
31 else if(instack[v]) low[now]=min(low[now],dfn[v]);
32 }
33 if(low[now]==dfn[now])
34 {
35 col[now]=++sumcol;
36 point[sumcol]++;
37 for(;Stack[top]!=now;top--)
38 {
39 col[Stack[top]]=sumcol;
40 point[sumcol]++;
41 instack[Stack[top]]=0;
42 }
43 top--; instack[now]=0;
44 }
45 }
46
47 int main()
48 {
49 int n,m,ans=0;
50 scanf("%d%d",&n,&m);
51 for(int u,v;m--;)
52 scanf("%d%d",&u,&v),ins(u,v);
53 DFS(1);
54 for(int i=1;i<=n;i++) if(!dfn[i])
55 for(int i=1;i<=sumcol;i++)
56 if(point[i]>1) ans+=point[i];
57 if(ans) printf("T_T\n%d",ans);
58 else printf("o(∩_∩)o");
59 return 0;
60 }