counts branches