There has been yet another murder in the Shady city of Riverdale. This murder is being investigated by none other than the Riverdale's Finest- Jughead Jones & Betty Cooper. This murder has been done exactly in the same manner as all the murders happening since the return of the deadly game Gargoyle &Griffins. Betty has decided to put an end to these murders, so they decide to interrogate each and every person in the neighbourhood.
As they don't know these people personally they want to first get to know about their character i.e whether a particular person is a Truth−speaking−person$Truth-speaking-person$ or a False−speaking−person$False-speaking-person$. Jughead devises a strategy of interrogating the civilians.
Jughead decides that they will collect statements from all the people in the neighbourhood about every other person living in the neighbourhood. Each person speaks a statement in form of an array consisting of T$T$ and F$ F$, which tells us what he thinks about the ith$ith$ person. Let there be N$N$ people living in the neighbourhood. So if a person i$i$ is giving his/her statement, he/her will always call himself/herself a True person i.e Statement[i]=T$Statement[i]=T$.
So Jughead says that they will select the maximum$maximum$ number$number$ of people that maybe speaking the truth such that their statements don't contradict and then interrogate them further about the murder.
Help them pick the max no. of Truth speaking people.
Note$Note$- A person speaking falsely$falsely$ doesn't mean that the complement of his statement would be the truth$truth$. If a person is declared false$false$(i.e not included in the set) after Betty and Jughead pick their set of truth speaking people with non-contradicting statements, the person declared false might not be speaking falsely$falsely$ about anyone(except saying he himself is a true$true$ speaking person which contradicts with the selected statements) but since the selected Set of statements feels him to be a false$false$ speaking person he won't be included in the set. 
But if a person is tagged as truth$truth$ speaking person then their Statement must be entirely correct and should not contradict with the chosen set of truth$truth$ speaking people. All truth$truth$ speaking people mentioned in the selected statements should be part of the set and all the people declared false$false$ in the statements shouldn't be part of the set.
See example for clarity.

-----Input:-----
- First line will contain N$N$, the number of people in the neighbourhood. Then the Statements of ith$ith$ person follow. 
- Each Statement contains a single line of input, an array of length N$N$ consisting of T$T$ and F$F$.

-----Output:-----
Print a single line denoting the maximum no. of people that might be speaking the truth.

-----Constraints-----
- 1≤N≤1000$1 \leq N \leq 1000$
- Statement$Statement$i$i$[i]=T$[i]=T$

-----Sample Input1:-----
5
T T F F F
T T F F F
T T T F F
F F F T T
F F F T T

-----Sample Output1:-----
2

-----Sample Input2:-----
3
T T T
T T T
F F T

-----Sample Output2:-----
1

-----EXPLANATION:-----
In Sample 1
We can consider the 1st$1st$ and 2nd$2nd$ person to be speaking the truth. We can also consider the 4th$4th$ and the 5th$5th$ person to be speaking the truth. 
Note$Note$: we cannot select 1st$1st$ 2nd$2nd$ and 3rd$3rd$ person because the 1st$1st$ and the second person have labelled the 3rd person as a false speaking person, therefore if we select all 3 contradiction will arise.
In sample 2
Set contains only the 3rd person

Difficulty: interview

Starter code:

Solutions:
N=int(input())
l=[]
for i in range (N):
    a=input().split()
    l.append(a)
count = 0
for i in range(N):
    flag = 0
    value=l[i].count('T')
    for j in range (N):
     if l[i][j] =='T' and i!=j :
      if l[i] == l[j]:
       continue
      else:
       flag=1
       break
    if flag==0 and count<value:
     count=value
print(count)

# cook your dish here
# cook your dish here

N=int(input())
l=[]
for i in range (N):
    a=input().split()
    l.append(a)
count = 0
for i in range(N):
    marker = 0
    value=l[i].count('T')
    for j in range (N):
     if l[i][j] =='T' and i!=j :
      if l[i] == l[j]:
       continue
      else:
       marker=1
       break
    if marker==0 and count<value:
     count=value
print(count)

# cook your dish here

N=int(input())
l=[]
for i in range (N):
    a=input().split()
    l.append(a)
count = 0
for i in range(N):
    marker = 0
    value=l[i].count('T')
    for j in range (N):
     if l[i][j] =='T' and i!=j :
      if l[i] == l[j]:
       continue
      else:
       marker=1
       break
    if marker==0 and count<value:
     count=value
print(count)

# cook your dish here
testCases=int(input())
answers=[]
for i in range (testCases):
    a=input().split()
    answers.append(a)
count = 0
for i in range(testCases):
    flag = 0
    ans=answers[i].count('T')
    #print(answers[i])
    for j in range (testCases):
     if answers[i][j] =='T' and i!=j :
      if answers[i] == answers [j]:
       continue
      else:
  #           print("HII")
       flag=1
       break
    if flag==0 and count<ans:
     count=ans
print(count)

# cook your dish here
testCases=int(input())
answers=[]
for i in range (testCases):
    a=input().split()
    answers.append(a)
count = 0
for i in range(testCases):
    flag = 0
    ans=answers[i].count('T')
    for j in range (testCases):
     if answers[i][j] =='T' and i!=j :
      if answers[i] == answers [j]:
       continue
      else:
       flag=1
       break
    if flag==0 and count<ans:
     count=ans
print(count)

# cook your dish here
n=int(input())
data=[]
for _ in range(n):
    temp = list(input().split())
    val=''
    for i in temp:
     if(i=='T'):
      val+='1'
     else:
      val+='0'
    data.append(int(val,2))
f={}
for i in data:
    if(i in f):
     f[i]+=1
    else:
     f[i]=1
ans=[0]

for i in data:
    if(bin(i).count('1')==f[i]):
     ans.append(f[i])

print(max(ans))

n=int(input())
data=[]
for _ in range(n):
    temp = list(input().split())
    val=''
    for i in temp:
     if(i=='T'):
      val+='1'
     else:
      val+='0'
    data.append(int(val,2))
f={}
for i in data:
    if(i in f):
     f[i]+=1
    else:
     f[i]=1
ans=[0]

for i in data:
    if(bin(i).count('1')==f[i]):
     ans.append(f[i])

print(max(ans))

testCases=int(input())
answers=[]
for i in range (testCases):
    a=input().split()
    answers.append(a)
# print(answers)
# for i in range(len(answers)):
#     print(answers[i])
count = 0
for i in range(testCases):
    flag = 0
    ans=answers[i].count('T')
    for j in range (testCases):
     if answers[i][j] =='T' and i!=j :
      if answers[i] == answers [j]:
       continue
      else:
       flag=1
       break
    if flag==0 and count<ans:
     count=ans
print(count)

# cook your dish here
N = int(input())

D = {}
for i in range(N):
    T = [x for x in input().split()]
    if T[i] == 'T':
     L = []
     for j in range(N):
      if T[j] == 'T':
       L.append(j)
     x = tuple(L)
     if x in D:
      D[x] += 1
     else:
      D[x] = 1
best = 0
for i in D:
    if len(i) == D[i]:
     best = max(best,D[i])

print(best)


testCases=int(input())
answers=[]
for i in range (testCases):
    a=input().split()
    answers.append(a)
# print(answers)
# for i in range(len(answers)):
#     print(answers[i])
count = 0
for i in range(testCases):
    flag = 0
    ans=answers[i].count('T')
    for j in range (testCases):
     if answers[i][j] =='T' and i!=j :
      if answers[i] == answers [j]:
       continue
      else:
       flag=1
       break
    if flag==0 and count<ans:
     count=ans
print(count)

from collections import Counter

n = int(input())
arr = []
for i in range(n):
    s = map(str,input().split())
    arr.append("".join(s))

c = Counter(arr)
keys = list(c.keys())
ans = []

for item in keys:
    x = c[item]
    if x == item.count("T"):
     ans.append(x)

if len(ans) != 0:
    print(max(ans))
else:
    print(0)

from collections import Counter

n = int(input())
arr = []
for i in range(n):
    s = list(map(str,input().split()))
    arr.append("".join(s))

c = Counter(arr)
k=list(c.keys())
ans = []

for item in k:
    x = c[item]
    if x==item.count("T"):
     ans.append(x)

if len(ans)!=0:
    print(max(ans))
else:
    print(0)