A farmer is planting two types of crops, corn and wheat. The profit per acre for corn is $150, while for wheat it is $200. The farmer wants to maximize his profit by planting at most 30 acres of corn and at most 20 acres of wheat. The total amount of land available for planting is 50 acres.
Let x represent the number of acres of corn planted and y represent the number of acres of wheat planted. The farmer's profit can be represented by the equation:
$$ P = 150x + 200y $$
Find the maximum number of acres of corn (x) the farmer can plant that will maximize his profit while still meeting the land constraints.