{"raw_statement":[{"iden":"statement","content":"_\"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am the watcher on the walls. I am the shield that guards the realms of men. I pledge my life and honor to the Night's Watch, for this night and all the nights to come.\"_ — The Night's Watch oath.\n\nWith that begins the watch of Jon Snow. He is assigned the task to support the stewards.\n\nThis time he has _n_ stewards with him whom he has to provide support. Each steward has his own strength. Jon Snow likes to support a steward only if there exists at least one steward who has strength strictly less than him and at least one steward who has strength strictly greater than him.\n\nCan you find how many stewards will Jon support?"},{"iden":"input","content":"First line consists of a single integer _n_ (1 ≤ _n_ ≤ 105) — the number of stewards with Jon Snow.\n\nSecond line consists of _n_ space separated integers _a_1, _a_2, ..., _a__n_ (0 ≤ _a__i_ ≤ 109) representing the values assigned to the stewards."},{"iden":"output","content":"Output a single integer representing the number of stewards which Jon will feed."},{"iden":"examples","content":"Input\n\n2\n1 5\n\nOutput\n\n0\n\nInput\n\n3\n1 2 5\n\nOutput\n\n1"},{"iden":"note","content":"In the first sample, Jon Snow cannot support steward with strength 1 because there is no steward with strength less than 1 and he cannot support steward with strength 5 because there is no steward with strength greater than 5.\n\nIn the second sample, Jon Snow can support steward with strength 2 because there are stewards with strength less than 2 and greater than 2."}],"translated_statement":[{"iden":"statement","content":"_\"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am the watcher on the walls. I am the shield that guards the realms of men. I pledge my life and honor to the Night's Watch, for this night and all the nights to come.\"_ — The Night's Watch oath.\n\nWith that begins the watch of Jon Snow. He is assigned the task to support the stewards.\n\nThis time he has #cf_span[n] stewards with him whom he has to provide support. Each steward has his own strength. Jon Snow likes to support a steward only if there exists at least one steward who has strength strictly less than him and at least one steward who has strength strictly greater than him.\n\nCan you find how many stewards will Jon support?\n\nFirst line consists of a single integer #cf_span[n] (#cf_span[1 ≤ n ≤ 105]) — the number of stewards with Jon Snow.\n\nSecond line consists of #cf_span[n] space separated integers #cf_span[a1, a2, ..., an] (#cf_span[0 ≤ ai ≤ 109]) representing the values assigned to the stewards.\n\nOutput a single integer representing the number of stewards which Jon will feed.\n\nIn the first sample, Jon Snow cannot support steward with strength #cf_span[1] because there is no steward with strength less than #cf_span[1] and he cannot support steward with strength #cf_span[5] because there is no steward with strength greater than #cf_span[5].\n\nIn the second sample, Jon Snow can support steward with strength #cf_span[2] because there are stewards with strength less than #cf_span[2] and greater than #cf_span[2].\n\n"},{"iden":"input","content":"第一行包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 105]) —— 与琼·雪诺在一起的管家数量。\n第二行包含 #cf_span[n] 个用空格分隔的整数 #cf_span[a1, a2, ..., an] (#cf_span[0 ≤ ai ≤ 109])，表示分配给各管家的数值。"},{"iden":"output","content":"输出一个整数，表示琼将支持的管家数量。"},{"iden":"examples","content":"输入\n2\n1 5\n输出\n0\n\n输入\n3\n1 2 5\n输出\n1"},{"iden":"note","content":"在第一个测试用例中，琼·雪诺无法支持强度为 #cf_span[1] 的管家，因为不存在强度小于 #cf_span[1] 的管家；他也无法支持强度为 #cf_span[5] 的管家，因为不存在强度大于 #cf_span[5] 的管家。\n在第二个测试用例中，琼·雪诺可以支持强度为 #cf_span[2] 的管家，因为存在强度小于 #cf_span[2] 和大于 #cf_span[2] 的管家。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of stewards.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of non-negative integers representing the strengths of the stewards.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 10^5 $  \n2. $ 0 \\leq a_i \\leq 10^9 $ for all $ i \\in \\{1, \\dots, n\\} $\n\n**Objective**  \nCount the number of stewards $ a_i \\in A $ such that:  \n$$\n\\exists\\, a_j, a_k \\in A \\text{ with } a_j < a_i < a_k\n$$  \nThat is, $ a_i $ is neither the minimum nor the maximum of $ A $.","simple_statement":null,"has_page_source":false}