The number in the middle of the first triangle is found with the folowing calculation: 8 / 2 - 18 = -14
The number in the middle of the second triangle is found with the folowing calculation: : 40 / 5 - 13 = -5
Therefore the question mark should be replaced with the number: 40