

from collections import deque
from math import floor
from random import random
from time import time


class  A						:







    """simple docstring"""





    def __init__(      self :       List[Any]		)->    Optional[int]:





        '''simple docstring'''







        A__          =   {}


    def 						snake_case__     (      self :       Dict,lowercase_ :       Union[str, Any],lowercase_ :       str,lowercase_ :       List[str]=1		)->    Optional[Any]:





        '''simple docstring'''







        if self.graph.get(lowercase_		):
            if self.graph[u].count([w, v]		) == 0:
                self.graph[u].append([w, v]		)
        else:
            A__          =   [[w, v]]
        if not self.graph.get(lowercase_		):
            A__          =   []


    def 						snake_case__     (      self :       List[Any]		)->    str:





        '''simple docstring'''







        return list(self.graph		)


    def 						snake_case__     (      self :       Dict,lowercase_ :       Optional[int],lowercase_ :       List[Any]		)->    List[Any]:





        '''simple docstring'''







        if self.graph.get(lowercase_		):
            for _ in self.graph[u]:
                if _[1] == v:
                    self.graph[u].remove(lowercase_		)


    def 						snake_case__     (      self :       List[Any],lowercase_ :       Optional[int]=-2,lowercase_ :       str=-1		)->    List[Any]:





        '''simple docstring'''







        if s == d:
            return []
        A__          =   []
        A__          =   []
        if s == -2:
            A__          =   list(self.graph		)[0]
        stack.append(lowercase_		)
        visited.append(lowercase_		)
        A__          =   s

        while True:
            # check if there is any non isolated nodes
            if len(self.graph[s]		) != 0:
                A__          =   s
                for node in self.graph[s]:
                    if visited.count(node[1]		) < 1:
                        if node[1] == d:
                            visited.append(lowercase_		)
                            return visited
                        else:
                            stack.append(node[1]		)
                            visited.append(node[1]		)
                            A__          =   node[1]
                            break

            # check if all the children are visited
            if s == ss:
                stack.pop()
                if len(lowercase_		) != 0:
                    A__          =   stack[len(lowercase_		) - 1]
            else:
                A__          =   ss

            # check if se have reached the starting point
            if len(lowercase_		) == 0:
                return visited


    def 						snake_case__     (      self :       List[Any],lowercase_ :       str=-1		)->    str:





        '''simple docstring'''







        if c == -1:
            A__          =   floor(random() * 1_0_0_0_0		) + 1_0
        for i in range(lowercase_		):
            # every vertex has max 100 edges
            for _ in range(floor(random() * 1_0_2		) + 1		):
                A__          =   floor(random() * c		) + 1
                if n != i:
                    self.add_pair(lowercase_,lowercase_,1		)


    def 						snake_case__     (      self :       Dict,lowercase_ :       Dict=-2		)->    int:





        '''simple docstring'''







        A__          =   deque()
        A__          =   []
        if s == -2:
            A__          =   list(self.graph		)[0]
        d.append(lowercase_		)
        visited.append(lowercase_		)
        while d:
            A__          =   d.popleft()
            if len(self.graph[s]		) != 0:
                for node in self.graph[s]:
                    if visited.count(node[1]		) < 1:
                        d.append(node[1]		)
                        visited.append(node[1]		)
        return visited


    def 						snake_case__     (      self :       Optional[Any],lowercase_ :       Optional[int]		)->    Optional[Any]:





        '''simple docstring'''







        A__          =   0
        for x in self.graph:
            for y in self.graph[x]:
                if y[1] == u:
                    count += 1
        return count


    def 						snake_case__     (      self :       Tuple,lowercase_ :       Optional[Any]		)->    Any:





        '''simple docstring'''







        return len(self.graph[u]		)


    def 						snake_case__     (      self :       Union[str, Any],lowercase_ :       int=-2		)->    int:





        '''simple docstring'''







        A__          =   []
        A__          =   []
        if s == -2:
            A__          =   list(self.graph		)[0]
        stack.append(lowercase_		)
        visited.append(lowercase_		)
        A__          =   s
        A__          =   []

        while True:
            # check if there is any non isolated nodes
            if len(self.graph[s]		) != 0:
                A__          =   s
                for node in self.graph[s]:
                    if visited.count(node[1]		) < 1:
                        stack.append(node[1]		)
                        visited.append(node[1]		)
                        A__          =   node[1]
                        break

            # check if all the children are visited
            if s == ss:
                sorted_nodes.append(stack.pop()		)
                if len(lowercase_		) != 0:
                    A__          =   stack[len(lowercase_		) - 1]
            else:
                A__          =   ss

            # check if se have reached the starting point
            if len(lowercase_		) == 0:
                return sorted_nodes


    def 						snake_case__     (      self :       int		)->    Optional[int]:





        '''simple docstring'''







        A__          =   []
        A__          =   []
        A__          =   list(self.graph		)[0]
        stack.append(lowercase_		)
        visited.append(lowercase_		)
        A__          =   -2
        A__          =   []
        A__          =   s
        A__          =   False
        A__          =   set()

        while True:
            # check if there is any non isolated nodes
            if len(self.graph[s]		) != 0:
                A__          =   s
                for node in self.graph[s]:
                    if (
                        visited.count(node[1]		) > 0
                        and node[1] != parent
                        and indirect_parents.count(node[1]		) > 0
                        and not on_the_way_back
                    ):
                        A__          =   len(lowercase_		) - 1
                        while len_stack >= 0:
                            if stack[len_stack] == node[1]:
                                anticipating_nodes.add(node[1]		)
                                break
                            else:
                                anticipating_nodes.add(stack[len_stack]		)
                                len_stack -= 1
                    if visited.count(node[1]		) < 1:
                        stack.append(node[1]		)
                        visited.append(node[1]		)
                        A__          =   node[1]
                        break

            # check if all the children are visited
            if s == ss:
                stack.pop()
                A__          =   True
                if len(lowercase_		) != 0:
                    A__          =   stack[len(lowercase_		) - 1]
            else:
                A__          =   False
                indirect_parents.append(lowercase_		)
                A__          =   s
                A__          =   ss

            # check if se have reached the starting point
            if len(lowercase_		) == 0:
                return list(lowercase_		)


    def 						snake_case__     (      self :       List[Any]		)->    Union[str, Any]:





        '''simple docstring'''







        A__          =   []
        A__          =   []
        A__          =   list(self.graph		)[0]
        stack.append(lowercase_		)
        visited.append(lowercase_		)
        A__          =   -2
        A__          =   []
        A__          =   s
        A__          =   False
        A__          =   set()

        while True:
            # check if there is any non isolated nodes
            if len(self.graph[s]		) != 0:
                A__          =   s
                for node in self.graph[s]:
                    if (
                        visited.count(node[1]		) > 0
                        and node[1] != parent
                        and indirect_parents.count(node[1]		) > 0
                        and not on_the_way_back
                    ):
                        A__          =   len(lowercase_		) - 1
                        while len_stack_minus_one >= 0:
                            if stack[len_stack_minus_one] == node[1]:
                                anticipating_nodes.add(node[1]		)
                                break
                            else:
                                return True
                    if visited.count(node[1]		) < 1:
                        stack.append(node[1]		)
                        visited.append(node[1]		)
                        A__          =   node[1]
                        break

            # check if all the children are visited
            if s == ss:
                stack.pop()
                A__          =   True
                if len(lowercase_		) != 0:
                    A__          =   stack[len(lowercase_		) - 1]
            else:
                A__          =   False
                indirect_parents.append(lowercase_		)
                A__          =   s
                A__          =   ss

            # check if se have reached the starting point
            if len(lowercase_		) == 0:
                return False


    def 						snake_case__     (      self :       Tuple,lowercase_ :       List[Any]=-2,lowercase_ :       Optional[int]=-1		)->    int:





        '''simple docstring'''







        A__          =   time()
        self.dfs(lowercase_,lowercase_		)
        A__          =   time()
        return end - begin


    def 						snake_case__     (      self :       int,lowercase_ :       List[str]=-2		)->    Union[str, Any]:





        '''simple docstring'''







        A__          =   time()
        self.bfs(lowercase_		)
        A__          =   time()
        return end - begin




class  A						:







    """simple docstring"""





    def __init__(      self :       Tuple		)->    Optional[Any]:





        '''simple docstring'''







        A__          =   {}


    def 						snake_case__     (      self :       str,lowercase_ :       Optional[Any],lowercase_ :       str,lowercase_ :       Any=1		)->    Union[str, Any]:





        '''simple docstring'''







        if self.graph.get(lowercase_		):
            # if there already is a edge
            if self.graph[u].count([w, v]		) == 0:
                self.graph[u].append([w, v]		)
        else:
            # if u does not exist
            A__          =   [[w, v]]
        # add the other way
        if self.graph.get(lowercase_		):
            # if there already is a edge
            if self.graph[v].count([w, u]		) == 0:
                self.graph[v].append([w, u]		)
        else:
            # if u does not exist
            A__          =   [[w, u]]


    def 						snake_case__     (      self :       List[str],lowercase_ :       Optional[int],lowercase_ :       Optional[int]		)->    List[Any]:





        '''simple docstring'''







        if self.graph.get(lowercase_		):
            for _ in self.graph[u]:
                if _[1] == v:
                    self.graph[u].remove(lowercase_		)
        # the other way round
        if self.graph.get(lowercase_		):
            for _ in self.graph[v]:
                if _[1] == u:
                    self.graph[v].remove(lowercase_		)


    def 						snake_case__     (      self :       Dict,lowercase_ :       Any=-2,lowercase_ :       List[str]=-1		)->    Any:





        '''simple docstring'''







        if s == d:
            return []
        A__          =   []
        A__          =   []
        if s == -2:
            A__          =   list(self.graph		)[0]
        stack.append(lowercase_		)
        visited.append(lowercase_		)
        A__          =   s

        while True:
            # check if there is any non isolated nodes
            if len(self.graph[s]		) != 0:
                A__          =   s
                for node in self.graph[s]:
                    if visited.count(node[1]		) < 1:
                        if node[1] == d:
                            visited.append(lowercase_		)
                            return visited
                        else:
                            stack.append(node[1]		)
                            visited.append(node[1]		)
                            A__          =   node[1]
                            break

            # check if all the children are visited
            if s == ss:
                stack.pop()
                if len(lowercase_		) != 0:
                    A__          =   stack[len(lowercase_		) - 1]
            else:
                A__          =   ss

            # check if se have reached the starting point
            if len(lowercase_		) == 0:
                return visited


    def 						snake_case__     (      self :       Tuple,lowercase_ :       Any=-1		)->    Optional[int]:





        '''simple docstring'''







        if c == -1:
            A__          =   floor(random() * 1_0_0_0_0		) + 1_0
        for i in range(lowercase_		):
            # every vertex has max 100 edges
            for _ in range(floor(random() * 1_0_2		) + 1		):
                A__          =   floor(random() * c		) + 1
                if n != i:
                    self.add_pair(lowercase_,lowercase_,1		)


    def 						snake_case__     (      self :       Union[str, Any],lowercase_ :       List[Any]=-2		)->    Union[str, Any]:





        '''simple docstring'''







        A__          =   deque()
        A__          =   []
        if s == -2:
            A__          =   list(self.graph		)[0]
        d.append(lowercase_		)
        visited.append(lowercase_		)
        while d:
            A__          =   d.popleft()
            if len(self.graph[s]		) != 0:
                for node in self.graph[s]:
                    if visited.count(node[1]		) < 1:
                        d.append(node[1]		)
                        visited.append(node[1]		)
        return visited


    def 						snake_case__     (      self :       Optional[Any],lowercase_ :       int		)->    Optional[Any]:





        '''simple docstring'''







        return len(self.graph[u]		)


    def 						snake_case__     (      self :       Union[str, Any]		)->    str:





        '''simple docstring'''







        A__          =   []
        A__          =   []
        A__          =   list(self.graph		)[0]
        stack.append(lowercase_		)
        visited.append(lowercase_		)
        A__          =   -2
        A__          =   []
        A__          =   s
        A__          =   False
        A__          =   set()

        while True:
            # check if there is any non isolated nodes
            if len(self.graph[s]		) != 0:
                A__          =   s
                for node in self.graph[s]:
                    if (
                        visited.count(node[1]		) > 0
                        and node[1] != parent
                        and indirect_parents.count(node[1]		) > 0
                        and not on_the_way_back
                    ):
                        A__          =   len(lowercase_		) - 1
                        while len_stack >= 0:
                            if stack[len_stack] == node[1]:
                                anticipating_nodes.add(node[1]		)
                                break
                            else:
                                anticipating_nodes.add(stack[len_stack]		)
                                len_stack -= 1
                    if visited.count(node[1]		) < 1:
                        stack.append(node[1]		)
                        visited.append(node[1]		)
                        A__          =   node[1]
                        break

            # check if all the children are visited
            if s == ss:
                stack.pop()
                A__          =   True
                if len(lowercase_		) != 0:
                    A__          =   stack[len(lowercase_		) - 1]
            else:
                A__          =   False
                indirect_parents.append(lowercase_		)
                A__          =   s
                A__          =   ss

            # check if se have reached the starting point
            if len(lowercase_		) == 0:
                return list(lowercase_		)


    def 						snake_case__     (      self :       Optional[Any]		)->    Tuple:





        '''simple docstring'''







        A__          =   []
        A__          =   []
        A__          =   list(self.graph		)[0]
        stack.append(lowercase_		)
        visited.append(lowercase_		)
        A__          =   -2
        A__          =   []
        A__          =   s
        A__          =   False
        A__          =   set()

        while True:
            # check if there is any non isolated nodes
            if len(self.graph[s]		) != 0:
                A__          =   s
                for node in self.graph[s]:
                    if (
                        visited.count(node[1]		) > 0
                        and node[1] != parent
                        and indirect_parents.count(node[1]		) > 0
                        and not on_the_way_back
                    ):
                        A__          =   len(lowercase_		) - 1
                        while len_stack_minus_one >= 0:
                            if stack[len_stack_minus_one] == node[1]:
                                anticipating_nodes.add(node[1]		)
                                break
                            else:
                                return True
                    if visited.count(node[1]		) < 1:
                        stack.append(node[1]		)
                        visited.append(node[1]		)
                        A__          =   node[1]
                        break

            # check if all the children are visited
            if s == ss:
                stack.pop()
                A__          =   True
                if len(lowercase_		) != 0:
                    A__          =   stack[len(lowercase_		) - 1]
            else:
                A__          =   False
                indirect_parents.append(lowercase_		)
                A__          =   s
                A__          =   ss

            # check if se have reached the starting point
            if len(lowercase_		) == 0:
                return False


    def 						snake_case__     (      self :       Dict		)->    List[str]:





        '''simple docstring'''







        return list(self.graph		)


    def 						snake_case__     (      self :       Dict,lowercase_ :       Union[str, Any]=-2,lowercase_ :       str=-1		)->    str:





        '''simple docstring'''







        A__          =   time()
        self.dfs(lowercase_,lowercase_		)
        A__          =   time()
        return end - begin


    def 						snake_case__     (      self :       Optional[int],lowercase_ :       List[Any]=-2		)->    Dict:





        '''simple docstring'''







        A__          =   time()
        self.bfs(lowercase_		)
        A__          =   time()
        return end - begin




import os

# Precomputes a list of the 100 first triangular numbers
lowercase_       		=  [int(0.5 * n * (n + 1)) for n in range(1, 101)]
def 						_snake_case(    )							->      int:





    '''simple docstring'''






    A__          =   os.path.dirname(os.path.realpath(SCREAMING_SNAKE_CASE__      )      )
    A__          =   os.path.join(SCREAMING_SNAKE_CASE__    ,			'words.txt'      )

    A__          =   ''
    with open(SCREAMING_SNAKE_CASE__      ) as f:
        A__          =   f.readline()

    A__          =   [word.strip('"'      ) for word in words.strip('\r\n'      ).split(','      )]
    A__          =   [
        word
        for word in [sum(ord(SCREAMING_SNAKE_CASE__      ) - 64 for x in word      ) for word in words]
        if word in TRIANGULAR_NUMBERS
    ]
    return len(SCREAMING_SNAKE_CASE__      )


if __name__ == "__main__":
     print(solution())

