import java.util.HashMap; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); String[] genes = new String[n]; int[] health = new int[n]; for(int i=0; i healthMap = new HashMap(); for(int i=0; i= 0) tempHealth += healthMap.get(genes[j]); } maxHealth = Math.max(maxHealth, tempHealth); minHealth = Math.min(minHealth, tempHealth); } System.out.println(minHealth+" "+maxHealth); } public static int[] getPrefixArray(String pat){ int j=0, n=pat.length(); int[] prefix = new int[n]; prefix[0] = 0; for(int i=1; i0){ j=pre[j-1]; i--; } else j=0; } } if(j==pat.length()) return i-pat.length(); return -1; } }