In cells of a $2022 \times 2022$ table numbers from $1$ to $2022^2$ are written, in each cell exactly one number, all numbers are used once. For every row Vlad marks the second biggest number in it, Dima does the same for every column. It turned out that boys marked $4044$ pairwise distinct numbers, and there are $k$ numbers marked by Vlad, each of which is less than all numbers marked by Dima. Find the maximum possible value of $k$