+#!/usr/bin/python
+
+group_questions=[]
+questions=dict()
+people_count=0
+
+for line in open("input.txt", "r"):
+ line=line.rstrip()
+ if (line == ""):
+ all_yes="".join(questions.keys())
+ everyone_yes="".join([a for a in questions.keys() if questions[a] == people_count])
+ group_questions.append((all_yes, everyone_yes))
+ questions=dict()
+ people_count=0
+ continue
+ people_count+=1
+ for char in line:
+ if char in questions:
+ questions[char]+=1
+ else:
+ questions[char]=1
+
+if (len(questions.keys()) > 0):
+ all_yes="".join(questions.keys())
+ everyone_yes="".join([a for a in questions.keys() if questions[a] == people_count])
+ group_questions.append((all_yes, everyone_yes))
+
+sum_of_groups=0
+sum_of_everyone=0
+for group in group_questions:
+ sum_of_groups+=len(group[0])
+ sum_of_everyone+=len(group[1])
+
+
+print("Sum of groups: {}".format(sum_of_groups))
+print("Sum of groups (everyone said yes): {}".format(sum_of_everyone))