import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int answerQuery(String s, int l, int r) { // Return the answer for this query modulo 1000000007. int[] bucketarray=new int[26]; //ASCII is 97 to 122 //using bucketconcept for(int i=l-1;i1){ palinalp+= bucketarray[j]%2; palincount+=bucketarray[j]/2; } if(bucketarray[j]==1){ counter+=1; } } if(counter>1){ return counter+palinalp;} else{return palincount;} } public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.next();//main string int q = in.nextInt();//number of loops for queris for(int a0 = 0; a0 < q; a0++){ int l = in.nextInt();//start index+1 int r = in.nextInt();//end index+1 int result = answerQuery(s,l, r); System.out.println(result); } in.close(); } }