Sum keys with the same value : I have this object:

       obj = {1: 2, 4: 1, 5: 2};

How can I find and multiply only the keys with value 2 on other independent variables ?
I want to compare in this case 1*2 with 5*2. 
     
    var1 = 1*2;
    var2 = 5*2;

Thank you!
