Just to ensure there is an acceptable answer, but mainly summarizing other peoples' suggestions:
'Mathematically', what you want is the area under the curve abs(blue - grey)
.
These values (i.e. the absolute differences) are easily obtained, and once you have them, you can use any integration-like method (like Simpson's rule or what is suggested in the article you link to) to obtain the surface.
As an alternative, and somewhat like @Saurabh suggested, you can use the fact that the blue line is a step function (or isn't it?) and the other is a straight line. For this, you sum up all x values for which either the blue and grey lines cross, or a new value is presented (a 'step' is taken) in the blue line. Divididing the area like this will lead only to triangles and trapeziums, and you can simply take the absolute value before summing them all up.
Even if the blue line isn't a simple step function, but still made up of straight lines, this should work, although you now have to account for some additional cases...