I am given a list of lists as below.
A = [[F1,S1],[F2,S2],[F3,S3],[F1,S2],[F2,S3],[F3,S2],[F2,S1],[F4,S1],[F4,S3],[F5,S1]]
find the number of tuples where S==S1. Then out of those tuples, find the number of tuples where F1==F1.
How can I achieve this. in python