To count how many times the digit 3 appears in the numbers from 300 to 400, we need to consider each position individually:
1. Hundreds digit: The digit 3 appears as the hundreds digit in numbers from 300 to 399, a total of 100 times.
2. Tens digit: The digit 3 appears as the tens digit in numbers from 30 to 39 (inclusive), a total of 10 times.
3. Units digit: The digit 3 appears once in the numbers 303, 313, 323, 333, 343, 353, 363, 373, 383, 393. Therefore, it appears 10 times.
Adding these up, we get:
100 (hundreds digit) + 10 (tens digit) + 10 (units digit) = 120
So, Mohsen wrote the number 3 a total of 120 times.