Let S(n) denote digit sum of natural number n.
Let N be a smallest chaotigal number.
Say that k nines appear consecutively at the right end of N. Adding 1 to this number will cause k nines turn to k zeros, increase one of the digits by 1 and rest will not change. Therefore we can see that S(N)-S(N+1)=9k-1.
Both S(N) and S(N+1) are multiple of 2021 so 9k-1 also should be a multiple of 2021. This implies that k is at least 1572. k nines will be congruent to 1 (modulo 2021) so excluding those k nines, sum of digits must be congruent to 2020 modulo 2021. In other words, write N=m*10^k+999...9 then S(m) will be at least 2020. To minimize m we should make its rightmost digt 8 (since it can't be 9), put many nines as possible in the right. Thus minimum of m is 599...998 where there are 223 nines.
Hence we conclude that N=599...99899...99, where there are 223 nines in the first group of nines and 1572 nines in the second one. We finally get that minimum number of digits of N is 1798.