So You add the following js:
setPositions = function (){
var container = document.getElementById("container");
var redHeight = container.children[0].offsetHeight;
var blueOneHeight = container.children[1].offsetHeight;
var blueOneBottomMargin = parseFloat(window.getComputedStyle(container.children[1]).marginBottom);
var bluenTwoTopMargin = parseFloat(window.getComputedStyle(container.children[1]).marginTop);
var blueTwoHeight = redHeight-(blueOneHeight+blueOneBottomMargin+bluenTwoTopMargin)+2;
container.children[2].style.height = blueTwoHeight+"px";
}
to your fiddle and you get this fiddle.