Two men have equal shares in a herd of N cows. They sell all the cows for $N each. The money they get is in $10 bills plus less than ten $1 bills. One at a time they take a $10 bill. The man who takes the first $10 bill also takes the last one. The second man then takes all the $1 bills. How much does the first man owe the second?