return template length as signed