There are 5 third grade classes with 30 students each, so there are a total of 5 * 30 = 150 third grade students.
There are 4 fourth grade classes with 28 students each, so there are a total of 4 * 28 = 112 fourth grade students.
There are x fifth grade classes with 27 students each, so there are a total of x * 27 fifth grade students.
The total number of students is the sum of the number of third grade, fourth grade, and fifth grade students: 150 + 112 + x * 27 = 262 + 27x.
Each student gets a hamburger, which costs $2.10, some carrots, which cost $0.50, and a cookie, which costs $0.20.
The cost of one lunch for all the students is the sum of the cost of the hamburgers, the carrots, and the cookies: (262 + 27x) * (2.10 + 0.50 + 0.20) = (262 + 27x) * 2.80.
We are given that the cost of one lunch for all the students is $1036, so we can write: (262 + 27x) * 2.80 = 1036.
Dividing both sides by 2.80, we get: 262 + 27x = 370.
Subtracting 262 from both sides, we get: 27x = 108.
Dividing both sides by 27, we get: x = 4.
The value of x is 4.
#### 4
The answer is: 4
Below is a math problem. Provide a detailed, step-by-step solution.

### Problem:
Marla is planning the lunch menu for an elementary school. There are 5 third grade classes with 30 students each, 4 fourth grade classes with 28 students each, and x fifth grade classes with 27 students each. Each student gets a hamburger, which costs $2.10, some carrots, which cost $0.50, and a cookie, which cost $0.20. How much does one lunch for all the students cost?
If we know the answer to the above question is 1036, what is the value of unknown variable x?

### Answer:
