a magical string s consist 1 2 obey follow rulesThe string s magical concatenate number contiguous occurrence character 1 2 generate string s itselfthe element s s 1221121221221121122 if group consecutive 1s 2s s 1 22 11 2 1 22 1 22 11 2 11 22 occurrence 1 2s group 1 2 2 1 1 2 1 2 2 1 2 2 you occurrence sequence s itselfgiven integer n return number 1s n number magical string s example 1input n 6output 3explanation the 6 element magical string s 122112 contain 1s return 3example 2input n 1output 1 Constraints1 n 105