input: from typing import List
  from math import comb
  
  def count_subsequences(s: str, c: str) -> int:
      """
      Given a string s and a character c, calculate the number of 
      substrings in s that both begin and conclude with c.
  
      Examples:
      >>> s = "abada", c = "a"
      6
      >>> s = "zzz", c = "z"
      6
  
      Constraints:
      1 <= s.length <= 10^5
      s and c are composed solely of lowercase English letters.
      """
output:     count = 0
      n = len(s)
  
      # Find all positions of character c in string s
      positions = [i for i in range(n) if s[i] == c]
      
      # If there are fewer than 2 positions, there cannot be any subsequences
      if len(positions) < 2:
          return len(positions)
      
      # Calculate the number of subsequences
      for i in range(len(positions)):
          for j in range(i, len(positions)):
              count += 1
  
      return count