There are 3 ways of permuting the digits 2,5,7
For each permutation there are 5 places to put it the first digit and 4 places to put it the second digit.
There are 7-7 choices for what the other digits should be.
You are guaranteed that all five digits are distinct, so you don't have to worry about double-counting.
so N=3×4×5×7×7= 2940