There are 20 coins placed on a table such that tails is showing up. Suddenly electricity goes off and a boy sitting nearby inverts few coins and then he asks another boy to select some coins such that number of inverted coins is equal in every other subpart. He selects 8 coins and invert those 8 coins , and when electricity comes back he sees equal number of inverted coins in both subparts. Tell how many coins did first boy inverted.
P.S. The question is not original.