title: Get the sum of all Hashmap index sizes
body: <p>I am implementing a logic in which I have to multiply some integer with the size of the hashmap values in it. unfortunately, I am unable to do that. The attached picture <a href="https://i.stack.imgur.com/arJM6.png" rel="nofollow noreferrer">here</a> can provide me with all the size of the indexes. Now I want to sum all the sizes i.e. 0+2+1+1 and then multiply with my other integer. Is it possible? please help as I have no experience of hash mapping </p>
  
  <p><strong><em>EDIT: the size that is written on top i.e. 4 is not what i required. This size is basically the size of how many indexes are there which are 4. However i want the sum of below sizes i.e. if there are 4 values inside index 2 then the total sum would be 6</em></strong></p>