function solution(n) {
let count = 1;
let answer = 0;
while(count <= n) {
let sum = 0;
for(let i = count; i <= n; i ++) {
sum += i;
if(sum >= n) {
break;
}
}
(sum === n) && answer ++;
count ++;
}
return answer;
}