#include <stdio.h>

int main() {
    int count = 0;
    for (int i = 1; i <= 2019; i++) {
        int temp = i;          // 用临时变量分解数位
        while (temp > 0) {
            if (temp % 10 == 9) {

                count++;
                break;               // 找到一个9就跳出,避免重复计数
            }
            temp /= 10;
        }
    }
    printf("%d\n", count);
    return 0;
}