1827: 2018年计算机学院ACM创新实验室新生赛-CN出的周赛1的E是否还记得

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:5 Solved:1

Description

有n个数字,a1,a2,a3...,an;问你至少删除多少个数字,使得在剩下的数字中,任意三个数字都不能构成一个三角形。

Input

多组数据,对于每一组数据,首行输入一个正整数:n(1<=n<=1000)

Output

 一个正整数,代表你至少要删除的数的个数.

Sample Input Copy

9
1 2 3 4 5 6 7 8 9
5
20 2 6 4  11

Sample Output Copy

4
0