I want to write an IF statement that has more than one IF,

=IF(D5>3,2, IF D5>1,1," ")

why am i getting an error???