input: from typing import List
  from math import comb
  
  def count_occurrences(s: str, ch: str) -> int:
      """
      Given a string s and a character ch, calculate the total number of 
      substrings within s that start and end with ch.
  
      Examples:
      >>> s = "abada", ch = "a"
      6
      >>> s = "zzz", ch = "z"
      6
  
      Constraints:
      1 <= len(s) <= 10^5
      Both s and ch are composed of only lowercase English alphabet letters.
      """
output:     return comb(s.count(ch), 2) + s.count(ch) if s.count(ch) > 1 else s.count(ch)