The blacksmith can create a total of 400kg iron / 2kg iron per horseshoe = <<400/2=200>>200 horseshoes.
The farms need enough horseshoes for 2 farms * 2 horses each = <<2*2=4>>4 horses.
The stables need enough horseshoes for 5 stables * 2 horses each = <<5*2=10>>10 horses.
So in total, the farms and stables have 4 + 10 = <<4+10=14>>14 horses that need horseshoes.
This is a total of 14 horses * 4 horseshoes per horse = <<14*4=56>>56 horseshoes.
This means the blacksmith has 200 total horseshoes – 56 horseshoes for the stables and farms = 144 horseshoes left for the riding school.
The riding school therefore will have enough horseshoes for 144 horseshoes / 4 horseshoes per horse = <<144/4=36>>36 horses.
#### 36