{"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":"从前有一只名为 NaCly_Fish 的神鱼,她有一棵苹果树。\n\n有一天苹果熟了,每个点都有一个苹果。神鱼用魔法让苹果从树上掉了下来。\n\n每一秒,不在根上的苹果会掉到它的父节点上。在根上的苹果会被神鱼吃掉。\n\n如果某一个点上有不小于 2 个苹果,那么它们会两两抵消。即:x 个苹果会变成 x mod 2 个。\n\n神鱼 NaCly_Fish 想知道,她能吃到几个苹果。"}},{"title":"Input","value":{"format":"HTML","content":"输入的第一行包含单个整数n (2 ≤ n ≤ 100 000) —苹果树节点数。\n\n第二行输入包含n - 1个整数p2,p3,...,pn (1 ≤ pi \u003c i),其中第i个节点的父亲节点是pi。"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFish吃到的苹果数.\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n1 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\n1 2 2 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 3","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e18\n1 1 1 4 4 3 2 2 2 10 8 9 9 9 10 10 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn first example Arcady will be able to collect only one apple, initially situated in \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003est inflorescence. In next second apples from \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003end and \u003cspan class\u003d\"tex-span\"\u003e3\u003c/span\u003erd inflorescences will roll down and annihilate, and Arcady won\u0027t be able to collect them.\u003c/p\u003e\n\u003cp\u003eIn the second example Arcady will be able to collect 3 apples. First one is one initially situated in first inflorescence. In a second apple from \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003end inflorescence will roll down to \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003est (Arcady will collect it) and apples from \u003cspan class\u003d\"tex-span\"\u003e3\u003c/span\u003erd, \u003cspan class\u003d\"tex-span\"\u003e4\u003c/span\u003eth, \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003eth inflorescences will roll down to \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003end. Two of them will annihilate and one not annihilated will roll down from \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e-nd inflorescence to \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003est one in the next second and Arcady will collect it.\u003c/p\u003e"}}]}