Count LIS in [1,3,5,4,7]. Track dp[i] = length, count[i] = number of LIS ending at i. dp=[1,2,3,3,4]. For count: position 0 has 1. Position 1: extends from 0, so count[1]=1.
Position 2: extends from 1, count[2]=1. Position 3: extends from 1, count[3]=1. Position 4: extends from 2 or 3 (both length 3), so count[4]=count[2]+count[3]=2. Max length is 4 (only at position 4). Total LIS count: count[4]=2. They are [1,3,5,7] and [1,3,4,7].