Hi there I want to create a loop but I'm not sure how to go about it This is the contents of a file;

13
11
15
3
7
15
12
18
20
2

I have 10 check boxes and I want to check 3 of them and compare the 3 boxes to the 10 places in the file and see it they fit. The checked box counts as 1 and if the check box plus a place in the file is greater than 20 then I want an error message. e.g if I check box number 9 then there will be an error message as there is already 20 places in number 9 and if I check box number 8 then that's ok because it makes 8th place 19 The problem is all three check boxes have to be checked and if only one of them is greater than 20 when added to a place in the file then an error message will appear
Any ideas on how I might achieve this
Thanks for any replies