import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner scan = new Scanner(System.in)) { String S = scan.nextLine(); int ans = 0; for(int i=0; i= 2) { int tmp = 0; for(int j=count-1; j>=1; j--) { tmp += j; } ans += tmp; } } } if(ans == 0) { System.out.println(-1); } else { System.out.println(ans); } } } }