package Implementation;
import java.util.Scanner;
/*
* @author -- rajatgoyal715
*/
public class Encryption {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
char[] s = sc.next().toCharArray();
int l = s.length;
char[] b = new char[l];
int rows = (int) Math.floor(Math.sqrt(l));
int columns = (int) Math.ceil(Math.sqrt(l));
int min=0;
int min1 = rows*columns;
int min2 = rows*(columns-1);
int min3 = (rows+1)*columns;
if(min2