var firstNumStr = '';
var secondNumStr = '';
var thirdNumStr = '';
var whichNum = 1;

var feet = 0;
var shouldSum = false;
var content = $('#lol').text().split('');

for(var i = 0; i < content.length;++i) {
  if($.isNumeric(content[i])) {
    if(whichNum == 1) {
      firstNumStr += content[i];
    } else if(whichNum == 2) {
      secondNumStr += content[i];
    } else if(whichNum == 3) {
      thirdNumStr += content[i];
      if(i == content.length - 1)
        shouldSum = true;
    }
  } else if(content[i] == 'x') {
    whichNum++;
  } else {
    shouldSum = true; 
  }
  
  if(shouldSum) {
    
    var firstNum = parseInt(firstNumStr);
    var secondNum = parseInt(secondNumStr);
    var thirdNum = parseInt(thirdNumStr);
    
    var firstPseudoArea = firstNum * secondNum;
    var secondPseudoArea = firstNum * thirdNum;
    var thirdPseudoArea = secondNum * thirdNum;
    
    feet += ( 2 * firstPseudoArea) + (2 * secondPseudoArea) + (2 * thirdPseudoArea);
    
    feet += [firstPseudoArea, secondPseudoArea, thirdPseudoArea].sort()[0];
    
    whichNum = 1;
    firstNum = '';
    secondNum = '';
    thirdNum = ''; 
    shouldSum = false;
  }
$('#result').text('Result = ' + feet);

@@ -1,20 +1,55 @@
+$( document ).ready(function() %7B%0A  
 var firstNumStr = ''
@@ -46,24 +46,26 @@
 umStr = '';%0A
+  
 var secondNu
@@ -71,24 +71,26 @@
 umStr = '';%0A
+  
 var thirdNum
@@ -99,16 +99,18 @@
 r = '';%0A
+  
 var whic
@@ -119,17 +119,21 @@
 um = 1;%0A
-%0A
+  %0A  
 var feet
@@ -138,16 +138,18 @@
 et = 0;%0A
+  
 var shou
@@ -163,16 +163,18 @@
  false;%0A
+  
 var cont
@@ -207,17 +207,21 @@
 it('');%0A
-%0A
+  %0A  
 for(var 
@@ -253,16 +253,18 @@
 ;++i) %7B%0A
+  
   if($.i
@@ -291,16 +291,18 @@
 ) %7B%0A    
+ 
+ 
 if(which
@@ -309,24 +309,26 @@
 Num == 1) %7B%0A
+  
       firstN
@@ -344,32 +344,34 @@
 content%5Bi%5D;%0A    
+ 
+ 
 %7D else if(whichN
@@ -377,24 +377,26 @@
 Num == 2) %7B%0A
+  
       second
@@ -417,24 +417,26 @@
 ent%5Bi%5D;%0A    
+ 
+ 
 %7D else if(wh
@@ -446,24 +446,26 @@
 Num == 3) %7B%0A
+  
       thirdN
@@ -491,16 +491,18 @@
 ;%0A      
+ 
+ 
 if(i == 
@@ -525,24 +525,26 @@
  1)%0A        
+  
 shouldSum = 
@@ -553,14 +553,18 @@
 ue;%0A
+  
     %7D%0A
+  
   %7D 
@@ -588,24 +588,26 @@
 %5D == 'x') %7B%0A
+  
     whichNum
@@ -610,16 +610,18 @@
 hNum++;%0A
+  
   %7D else
@@ -623,16 +623,18 @@
  else %7B%0A
+  
     shou
@@ -654,13 +654,19 @@
  %0A  
-%7D%0A
+  %7D%0A  
   %0A
+  
   if
@@ -679,29 +679,33 @@
 dSum) %7B%0A    
-%0A
+  %0A 
     
+ 
 var firstNum
@@ -722,32 +722,34 @@
 t(firstNumStr);%0A
+  
     var secondNu
@@ -776,24 +776,26 @@
 umStr);%0A    
+ 
+ 
 var thirdNum
@@ -824,21 +824,25 @@
 r);%0A    
-%0A
+  %0A 
     
+ 
 var firs
@@ -873,24 +873,26 @@
  secondNum;%0A
+  
     var seco
@@ -927,24 +927,26 @@
 irdNum;%0A    
+ 
+ 
 var thirdPse
@@ -977,25 +977,29 @@
 irdNum;%0A    
-%0A
+  %0A  
     feet += 
@@ -1071,25 +1071,29 @@
 oArea);%0A    
-%0A
+  %0A  
     feet += 
@@ -1156,25 +1156,29 @@
 t()%5B0%5D;%0A    
-%0A
+  %0A  
     whichNum
@@ -1183,24 +1183,26 @@
 um = 1;%0A    
+  
 firstNum = '
@@ -1200,24 +1200,26 @@
 stNum = '';%0A
+  
     secondNu
@@ -1226,24 +1226,26 @@
 m = '';%0A    
+  
 thirdNum = '
@@ -1248,16 +1248,18 @@
  = ''; %0A
+  
     shou
@@ -1275,18 +1275,26 @@
 alse;%0A  
-%7D%0A
+  %7D%0A  %7D%0A  
 $('#resu
@@ -1324,8 +1324,12 @@
  feet);%0A
+%7D);%0A

Update custom.js