{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"在游戏《Nurse Love》中,有个分支剧情是因为B喜欢A,但是A喜欢C所以 A与C被杀掉了!\u003cp\u003e\n兔子大惊:“とても怖い!”\u003cp\u003e\n“如果游戏中有人互相喜欢就好了”兔子这样想着,可是游戏里面没有任何一个人和另一个人互相喜欢,要么是没有喜欢的人,要么是喜欢的人喜欢着别人,真是个悲剧!\u003cp\u003e\n这样的复杂喜欢形成了love链,如果说A喜欢B,那么B是A直接喜欢的人,这是直接喜欢关系。\u003cp\u003e\n而B喜欢C,这样C会与A成为间接怨恨关系,C喜欢D,那么D也会与A成为的间接怨恨关系. A,B,C,D都在一条love链上。\n\u003cp\u003e\n但是如果E喜欢A,E与C、D没有间接怨恨关系。\u003cp\u003e\n一个人物会杀掉与她有直接喜欢关系或者间接恩怨关系的人,为了不使得这样的结局出现,兔子进入游戏中,将n个人分在不同的城市里面,这样就不会发生惨案了!\u003cp\u003e\n\n\n\n请问至少要需要多少个城市才能使得惨案不发生?\n"}},{"title":"输入","value":{"format":"HTML","content":"\u003cdiv class\u003d\"input-specification\"\u003e\n \u003cdiv class\u003d\"section-title\"/div\u003e\n \u003cp\u003e第一行包含了整数 \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 2000\u003c/span\u003e) 代表游戏中人物个数。\u003c/p\u003e\n \u003cp\u003e接下来的 \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e 行包含了整数 \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003elove\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003elove\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ \u003ci\u003en\u003c/i\u003e\u003c/span\u003e 或 \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003elove\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e \u003d \u003c/span\u003e-1)。每一个 \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003elove\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e 表示第 \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e 个角色喜欢的人。如果 \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003elove\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e 是 -1,则意味着第 \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e 个角色没有喜欢的人。\u003c/p\u003e\n \u003cp\u003e数据保证:没有人会自己喜欢自己 (\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003elove\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≠ \u003ci\u003ei\u003c/i\u003e\u003c/span\u003e)。同时,不会出现A喜欢B,B喜欢C,C喜欢A的循环情况\u003c/p\u003e\n\u003c/div\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cdiv class\u003d\"output-specification\"\u003e\n \u003cdiv class\u003d\"section-title\"/div\u003e\n \u003cp\u003e打印一个唯一的整数,代表兔子需要的城市最小个数\u003c/p\u003e\n\u003c/div\u003e"}},{"title":"示例","value":{"format":"HTML","content":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e\u003cdiv class\u003d\"sample-tests\"\u003e\n \u003cdiv class\u003d\"section-title\"/div\u003e\n \u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n \u003cstrong\u003e输入\u003c/strong\u003e\n \u003c/div\u003e\n \u003cpre\u003e5\u003cbr\u003e-1\u003cbr\u003e1\u003cbr\u003e2\u003cbr\u003e3\u003cbr\u003e4\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n \u003cstrong\u003e输出\u003c/strong\u003e\n \u003c/div\u003e\n \u003cpre\u003e5\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003c/div\u003e\n\u003c/div\u003e\n\u003cp\u003e\n\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e\u003cdiv class\u003d\"sample-tests\"\u003e\n \u003cdiv class\u003d\"section-title\"/div\u003e\n \u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n \u003cstrong\u003e输入\u003c/strong\u003e\n \u003c/div\u003e\n \u003cpre\u003e4\u003cbr\u003e-1\u003cbr\u003e3\u003cbr\u003e1\u003cbr\u003e1\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n \u003cstrong\u003e输出\u003c/strong\u003e\n \u003c/div\u003e\n \u003cpre\u003e3\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003c/div\u003e\n\u003c/div\u003e\n"}},{"title":"备注","value":{"format":"HTML","content":"\u003cdiv class\u003d\"note\"\u003e\n \u003cdiv class\u003d\"section-title\"Note/div\u003e\n \u003cp\u003e对于第一个示例,五个城市是足够的,例如:\u003c/p\u003e\n \u003cul\u003e \n \u003cli\u003e 人物 1 \u003c/li\u003e\n \u003cli\u003e 人物 2\u003c/li\u003e\n \u003cli\u003e 人物 3\u003c/li\u003e\n \u003cli\u003e 人物 4 \u003c/li\u003e\n \u003cli\u003e 人物 5 \u003c/li\u003e\n \u003c/ul\u003e\n\u003c/div\u003e\n\u003cp\u003e\n\u003cdiv class\u003d\"note\"\u003e\n \u003cdiv class\u003d\"section-title\"Note/div\u003e\n \u003cp\u003e对于第二个示例,三个城市是足够的,例如:\u003c/p\u003e\n \u003cul\u003e \n \u003cli\u003e 人物 1 \u003c/li\u003e\n \u003cli\u003e 人物 2 和 4\u003c/li\u003e\n \u003cli\u003e 人物 3\u003c/li\u003e\n \u003c/ul\u003e\n\u003c/div\u003e\n"}}]}