The sequence of digits \(1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 \dots\) is obtained by writing the positive integers in order. If the \(10^n\)-th digit in this sequence occurs in the part of the sequence in which the \(m\)-digit numbers are placed, define \(f(n)\) to be \(m\). For example, \(f(2)=2\) because the 100th digit enters the sequence in the placement of the two-digit integer 55. Find, with proof, \(f(1987)\).

Let's think step by step and output the final answer within \boxed{}.
user