import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.nextLine(); StringBuilder sb = new StringBuilder(s); sb.deleteCharAt(sb.length() - 1);//删掉末尾的方括号 sb.deleteCharAt(0);//删掉开头的方括号 String[] v1 = String.valueOf(sb).split(","); int[] v2 = new int[v1.length]; for(int i = 0; i < v1.length; ++i) v2[i] = Integer.valueOf(v1[i]); Map<Integer, Integer> m = new HashMap<>();//用map来计数各整数的个数 for(int i = 0; i < v2.length; ++i){ if(m.containsKey(v2[i])){ int temp = m.get(v2[i]); m.put(v2[i], temp + 1); if(m.get(v2[i]) >= v2.length/2){//找到众数之后就直接返回 System.out.println(v2[i]); return; } }else m.put(v2[i], 1); } if(v2.length == 1) System.out.println(v2[0]);//数组中仅1个元素,直接返回 } }