We can note that after the first move, Anfisa picks up at least flowers since the shortest path from to traverses at least that many cells. Also, after each following move, she picks up at least one more flower.
Since the total number of flowers is n \cdot m, this already gives an upper bound on the answer as nm - (n+m-1) + 1 = (n-1)(m-1) + 1.
At the same time, we can show that Anfisa can always guarantee to receive at least that many pieces of cheese: On her first move, she moves from to (only vertically) and from to (only horizontally), picking up n+m-1 flowers.
On each of her next moves, she will try to pick up only one new flower — let be the bottom-most out of the left-most flowers. Anfisa moves then by straight line from to , from to , from to , and from to . Since was the bottom-most out of the left-most flowers, there are no other flowers on her path, and hence she collects exactly one flower during this move. Therefore, since after the first move there are nm - (n+m-1) = (n-1)(m-1) flowers left, Anfisa has a strategy to perform at least (n-1)(m-1) additional moves, making it in total (n-1)(m-1)+1 moves.
Hence, the answer is (n-1)(m-1)+1.