// 2024 IUSB Programming Competition // Round 1 Problem 2 // Substring Score // Solution by Liguo Yu import java.util.Scanner; public class round1_p2 { public static void main(String[] args) { Scanner input = new Scanner(System.in); String s1 = input.nextLine(); String s2 = input.nextLine(); int lastIndex = 0; int count = 0; while (lastIndex != -1) { lastIndex = s1.indexOf(s2, lastIndex); if (lastIndex != -1) { count++; lastIndex = lastIndex + s2.length(); } } System.out.println(count*s2.length()*s2.length()); } }