{% assign count = 0 %} {% for something in somethings %} {% assign count = count | plus: 1 %} {% endfor %} {{ count }}