시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 666 457 420 69.767%

문제

2~15개의 서로 다른 자연수로 이루어진 리스트가 있을 때, 이들 중 리스트 안에 자신의 정확히 2배인 수가 있는 수의 개수를 구하여라.

예를 들어, 리스트가 "1 4 3 2 9 7 18 22"라면 2가 1의 2배, 4가 2의 2배, 18이 9의 2배이므로 답은 3이다.

입력

입력은 여러 개의 테스트 케이스로 주어져 있으며, 입력의 끝에는 -1이 하나 주어진다.

각 테스트 케이스는 한 줄로 이루어져 있으며, 2~15개의 서로 다른 자연수가 주어진다. 각 자연수는 100보다 작으며, 리스트의 끝은 0으로 판별한다(0은 리스트에 속하지 않는다).

출력

각 테스트 케이스마다 한 줄에 걸쳐 정답을 출력한다.

예제 입력 1

1 4 3 2 9 7 18 22 0
2 4 8 10 0
7 5 11 13 1 3 0
-1

예제 출력 1

3
2
0
W3sicHJvYmxlbV9pZCI6IjQ2NDEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJEb3VibGVzIiwiZGVzY3JpcHRpb24iOiI8cD4yfjE1XHVhYzFjXHVjNzU4IFx1YzExY1x1Yjg1YyBcdWIyZTRcdWI5NzggXHVjNzkwXHVjNWYwXHVjMjE4XHViODVjIFx1Yzc3NFx1YjhlOFx1YzViNFx1YzljNCBcdWI5YWNcdWMyYTRcdWQyYjhcdWFjMDAgXHVjNzg4XHVjNzQ0IFx1YjU0YywgXHVjNzc0XHViNGU0IFx1YzkxMSBcdWI5YWNcdWMyYTRcdWQyYjggXHVjNTQ4XHVjNWQwIFx1Yzc5MFx1YzJlMFx1Yzc1OCBcdWM4MTVcdWQ2NTVcdWQ3ODggMlx1YmMzMFx1Yzc3OCBcdWMyMThcdWFjMDAgXHVjNzg4XHViMjk0IFx1YzIxOFx1Yzc1OCBcdWFjMWNcdWMyMThcdWI5N2MgXHVhZDZjXHVkNTU4XHVjNWVjXHViNzdjLjxcL3A+XHJcblxyXG48cD5cdWM2MDhcdWI5N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