count = 0; for x = 3:17 for y = -5:25 if ( ((x-10)^2+(y-10)^2<35) | ((x-10)^2+((y-10)^2/4)<50) ) count = count + 1; end end end printf("The number of grid points is %d\n", count);