Seunghyun was born on 5 March 1998, so he likes the digits 3, 5 and 8 that appear in his date of birth. He decided to call a positive integer a birthday number when its decimal representation consists only of the digits 3, 5 and 8. For example 3, 533 and 858553 are birthday numbers, while 3518, 1642 and 88808 are not.
Given a positive integer N, find the smallest birthday number whose digits sum to N.