There are 500 coffins and 500 hundred men who need them.The undertaker asks the first man to go to every coffin and open them,then he tells the 2nd man to go to every one and close it.The 3rd one goes to every 3rd coffin and so on.How many are open?