import java.util.*;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int upper =0;
        int lower = 0;
        int ans =0;
        for(int i=0;i<str.length();i++){
            if(str.charAt(i)<97){
                ans = (int)Math.min(lower,ans+1);
                upper++;
            }
            else{
                lower++;
            }
        }
        //System.out.println("upper : " + upper + "lower:" + lower);
        System.out.println(ans);
    }
}


import java.util.*;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int upper =0;
        int lower = 0;
        int ans =0;
        for(int i=1;i<str.length();i++){
            if(str.charAt(i)<97){
                ans = (int)Math.min(lower,ans+1);
            }
            else{
                lower++;
            }
        }
        System.out.println(ans);
    }
}


import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();

    }

    static int INF = (int)1e5*4*4+5;
    static int maxn = (int)1e7+5;
    static int mod=(int)1e9+7 ;
    static int n,m,k,t,q,x,a,b,y;

    void solve(PrintWriter out, Reader in) throws IOException{
        String str = in.next();
        n = str.length();
        int[] arr = new int[n];
        for(int i=0;i<n;i++)
            if(str.charAt(i)<'a') arr[i] =1;

        int[][] dp = new int[n][2];
        if(arr[0]==0) {
            dp[0][0] = 1;
            dp[0][1] = 0;
        }

        for(int i=1;i<n;i++){
            if(arr[i]==0){
                dp[i][0] = dp[i-1][0]+1;
                dp[i][1] = Math.min(dp[i-1][0],dp[i-1][1]);
            }else{
                dp[i][0] = dp[i-1][0];
                dp[i][1] = Math.min(dp[i-1][0],dp[i-1][1]+1);
            }
        }

        out.println(Math.min(dp[n-1][0],dp[n-1][1]));

    }

    //<>

    static class Reader {

    private InputStream mIs;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public Reader() {
        this(System.in);
    }

    public Reader(InputStream is) {
        mIs = is;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();

    }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = mIs.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public String next() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    }
}


//package codeforces;

import java.util.Scanner;

/**
 * https://codeforces.com/problemset/problem/180/C
 */
public class Letter {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);

		String s = in.nextLine();

		int lower = 0;
		int upper = 0;
		for (int i = 0; i < s.length(); i++) {
			if (i == 0) {
				if (Character.isLowerCase(s.charAt(i))) {
					lower = 0;
					upper = 1;
				} else {
					lower = 1;
					upper = 0;
				}
			} else  {
				int l = 0;
				int u = 0;
				if (Character.isLowerCase(s.charAt(i))) {
					l = Math.min(lower, upper);
					u = upper + 1;
				} else {
					l = Math.min(lower, upper) + 1;
					u = upper;
				}
				lower = l;
				upper = u;
			}
		}
		System.out.println(Math.min(lower, upper));
		in.close();
	}
}


import java.util.*;
import java.io.*;
public class Main
{
	public static void main(String[] args)throws Exception
	{
	    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	    PrintWriter pw=new PrintWriter(System.out);
	    char c[]=(br.readLine()).toCharArray();
	    int n=c.length;
	    int ct=0;
	    int cap[]=new int[n];
	    int sm[]=new int[n];//no. above cap and below small letters respectively
	    for(int i=0;i<n;i++)
	    {
	        if(Character.isUpperCase(c[i]))
	        {
	            cap[i]=ct;
	        }
	        else
	        {
	            ct++;
	            cap[i]=-1;
	        }
	    }
	    ct=0;
	    for(int i=n-1;i>=0;i--)
	    {
	        if(Character.isLowerCase(c[i]))
	        {
	            sm[i]=ct;
	        }
	        else
	        {
	            ct++;
	            sm[i]=-1;
	        }
	    }
	    //leftmost small letters
	    int ans=Integer.MAX_VALUE;
	    for(int i=0;i<n;i++)
	    {
	        if(sm[i]>=0)
	        {
	            ans=sm[i];
	            break;
	        }
	    }

	    for(int i=n-1;i>=0;i--)
	    {
	        if(cap[i]>=0)
	        {
	            if(ans>cap[i])
	            {
	                ans=cap[i];
	            }
	            break;
	        }
	    }
	    //Aa
        for(int i=0;i<=(n-2);i++)
        {
            if(cap[i]>=0 && cap[i+1]==-1)
            {
                ans=Math.min(ans,(cap[i]+sm[i+1]));
            }
        }
        pw.println(ans);
	    pw.flush();
	}
}


        			/*
        		     * Author- Priyam Vora
        		     * BTech 2nd Year DAIICT
        		     */

        		    import java.awt.Point;
import java.io.*;
        		    import java.math.*;
        		    import java.util.*;
        		    import javax.print.attribute.SetOfIntegerSyntax;

        		    public class Main{
        		    	private static InputStream stream;
        		    	private static byte[] buf = new byte[1024];
        		    	private static int curChar;
        		    	private static int numChars;
        		    	private static SpaceCharFilter filter;
        		    	private static PrintWriter pw;
        		    	private static long count = 0,mod=1000000007;
        		    //	private static TreeSet<Integer> ts=new TreeSet[200000];

        		        public static void main(String[] args) {
        		        	InputReader(System.in);
        		    		pw = new PrintWriter(System.out);
        		            new Thread(null ,new Runnable(){
        		               public void run(){
        		                   try{
        		                       soln2();
        		                       pw.close();
        		                   } catch(Exception e){
        		                       e.printStackTrace();
        		                   }
        		               }
        		           },"1",1<<26).start();
        		       }
        		        public static void Merge(long a[],int p,int r){
        		            if(p<r){
        		                int q = (p+r)/2;
        		                Merge(a,p,q);
        		                Merge(a,q+1,r);
        		                Merge_Array(a,p,q,r);
        		            }
        		        }
        		        public static void Merge_Array(long a[],int p,int q,int r){
        		           long b[] = new long[q-p+1];
        		            long c[] = new long[r-q];
        		            for(int i=0;i<b.length;i++)
        		                b[i] = a[p+i];
        		            for(int i=0;i<c.length;i++)
        		                c[i] = a[q+i+1];
        		            int i = 0,j = 0;
        		            for(int k=p;k<=r;k++){
        		                if(i==b.length){
        		                    a[k] = c[j];
        		                    j++;
        		                }
        		                else if(j==c.length){
        		                    a[k] = b[i];
        		                    i++;
        		                }
        		                else if(b[i]<c[j]){
        		                    a[k] = b[i];
        		                    i++;
        		                }
        		                else{
        		                    a[k] = c[j];
        		                    j++;
        		                }
        		            }
        		        }
        		    	public static long gcd(long x, long y) {
        		    		if (x == 0)
        		    			return y;
        		    		else
        		    			return gcd( y % x,x);
        		    	}	public static boolean isPrime(int n) {
        		    	// Corner cases
			    		if (n <= 1)
			    			return false;
			    		if (n <= 3)
			    			return true;

			    		// This is checked so that we can skip
			    		// middle five numbers in below loop
			    		if (n % 2 == 0 || n % 3 == 0)
			    			return false;

			    		for (int i = 5; i * i <= n; i = i + 6)
			    			if (n % i == 0 || n % (i + 2) == 0)
			    				return false;

			    		return true;
			    	}
        		        static LinkedList<Integer> adj[];
        		        static boolean Visited[];
        		        static HashSet<Integer> exc;
        		        static long oddsum[]=new long[1000001];
        		        static int co=0,ans=0;
        		        private static void soln2(){

        		        	String line = nextLine();
        		            char[] c = line.toCharArray();
        		            int n = c.length;

        		            int[] lowerCase = new int[n + 1];
        		            int[] upperCase = new int[n + 1];
        		            for (int i = 1; i <= n; i++) {
        		                lowerCase[i] = lowerCase[i - 1];
        		                if (Character.isLowerCase(c[i - 1])) {
        		                    lowerCase[i]++;
        		                }
        		            }
        		            for (int i = n - 1; i >= 0; i--) {
        		                upperCase[i] = upperCase[i + 1];
        		                if (Character.isUpperCase(c[i])) {
        		                    upperCase[i]++;
        		                }
        		            }

        		            int answer = Integer.MAX_VALUE;
        		            for (int i = 0; i <= n; i++) {
        		                answer = Math.min(answer, lowerCase[i] + upperCase[i]);
        		            }
        		            pw.println(answer);
        		        }

        		        private static void BFS(int n,int v,int w){
        		        	int level[]=new int[n+1];
        		        	boolean Visited[]=new boolean[n+1];
        		        	Queue<Integer> q=new LinkedList<Integer>();
        		        	q.add(v);
        		        	Visited[v]=true;
        		        	while(!q.isEmpty()){
        		        		int top=q.poll();

        		        		for(int i:adj[top]){
        		        			//pw.println(i+" "+top);
        		        			if(!Visited[i])
        		        			{
        		        				level[i]=level[top]+1;

        		        				q.add(i);
        		        			}

        		        			Visited[i]=true;
        		        			if(i==w){
        		        				if(level[i]<=5)
        		        				pw.println("Yes");
        		        				else
        		        					pw.println("No");
        		        				return;
        		        			}
        		        		}
        		        	}

        		        	pw.println("No");
        		        }

        		        private static long ncr(int n,int k){
    				    	if (k < 0 || k > n) return 0;
    				        if (n-k < k) k = n-k;

    				        BigInteger x = BigInteger.ONE;
    				        for (int i = 1; i <= k; i++) {
    				            x = x.multiply(new BigInteger(""+(n-i+1)));
    				            x = x.divide(new BigInteger(""+i));
    				        }

    				return x.longValue();
    				    }
        		       private  static long fact(long count){
        		        	long ans=1;
        		        	for(int i=1;i<=count;i++){
        		        		ans*=i;
        		        	}
        		        	return ans;
        		        }
        		        static long sort(int a[])
        		    	{  int n=a.length;
        		    		int b[]=new int[n];
        		    		return mergeSort(a,b,0,n-1);}
        		    	static long mergeSort(int a[],int b[],long left,long right)
        		    	{ long c=0;if(left<right)
        		    	 {   long mid=left+(right-left)/2;
        		    		 c= mergeSort(a,b,left,mid);
        		    		 c+=mergeSort(a,b,mid+1,right);
        		    		 c+=merge(a,b,left,mid+1,right); }
        		    		return c;	 }
        		    	static long merge(int a[],int  b[],long left,long mid,long right)
        		    	{long c=0;int i=(int)left;int j=(int)mid; int k=(int)left;
        		    	while(i<=(int)mid-1&&j<=(int)right)
        		    	{ if(a[i]>a[j]) {b[k++]=a[i++]; }
        		    	else	{ b[k++]=a[j++];c+=mid-i;}}
        		    	while (i <= (int)mid - 1)   b[k++] = a[i++];
        		    	while (j <= (int)right) b[k++] = a[j++];
        		    	for (i=(int)left; i <= (int)right; i++)
        		    		a[i] = b[i];  return c;  }

        		        static int state=1;
        		        static long no_exc=0,no_vert=0;
        		      static Stack<Integer> st;
        		      static HashSet<Integer> inset;
        		        private static void topo(int curr){

        		        	Visited[curr]=true;
        		        	inset.add(curr);
        		        	for(int x:adj[curr]){
        		        		if(adj[x].contains(curr) || inset.contains(x)){
        		        			state=0;
        		        			return;
        		        		}
        		        		if(state==0)
        		        			return;

        		        	}
        		        	st.push(curr);

        		        	inset.remove(curr);
        		        }
        		        static HashSet<Integer> hs;

        		     	private static void buildgraph(int n){
        		    		adj=new LinkedList[n+1];
        		    		Visited=new boolean[n+1];
        		    		st=new Stack<Integer>();
        		    		inset=new HashSet<Integer>();
        		    		exc=new HashSet<Integer>();

        		    		state=1;
        		    		for(int i=0;i<=n;i++){
        		    			adj[i]=new LinkedList<Integer>();

        		    		}

        		    	}

        		    	// To Get Input
        		    	// Some Buffer Methods

        		    	public static void InputReader(InputStream stream1) {
        		    		stream = stream1;
        		    	}

        		    	private static boolean isWhitespace(int c) {
        		    		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        		    	}

        		    	private static boolean isEndOfLine(int c) {
        		    		return c == '\n' || c == '\r' || c == -1;
        		    	}

        		    	private static int read() {
        		    		if (numChars == -1)
        		    			throw new InputMismatchException();
        		    		if (curChar >= numChars) {
        		    			curChar = 0;
        		    			try {
        		    				numChars = stream.read(buf);
        		    			} catch (IOException e) {
        		    				throw new InputMismatchException();
        		    			}
        		    			if (numChars <= 0)
        		    				return -1;
        		    		}
        		    		return buf[curChar++];
        		    	}

        		    	private static int nextInt() {
        		    		int c = read();
        		    		while (isSpaceChar(c))
        		    			c = read();
        		    		int sgn = 1;
        		    		if (c == '-') {
        		    			sgn = -1;
        		    			c = read();
        		    		}
        		    		int res = 0;
        		    		do {
        		    			if (c < '0' || c > '9')
        		    				throw new InputMismatchException();
        		    			res *= 10;
        		    			res += c - '0';
        		    			c = read();
        		    		} while (!isSpaceChar(c));
        		    		return res * sgn;
        		    	}

        		    	private static long nextLong() {
        		    		int c = read();
        		    		while (isSpaceChar(c))
        		    			c = read();
        		    		int sgn = 1;
        		    		if (c == '-') {
        		    			sgn = -1;
        		    			c = read();
        		    		}
        		    		long res = 0;
        		    		do {
        		    			if (c < '0' || c > '9')
        		    				throw new InputMismatchException();
        		    			res *= 10;
        		    			res += c - '0';
        		    			c = read();
        		    		} while (!isSpaceChar(c));
        		    		return res * sgn;
        		    	}

        		    	private static String nextToken() {
        		    		int c = read();
        		    		while (isSpaceChar(c))
        		    			c = read();
        		    		StringBuilder res = new StringBuilder();
        		    		do {
        		    			res.appendCodePoint(c);
        		    			c = read();
        		    		} while (!isSpaceChar(c));
        		    		return res.toString();
        		    	}

        		    	private static String nextLine() {
        		    		int c = read();
        		    		while (isSpaceChar(c))
        		    			c = read();
        		    		StringBuilder res = new StringBuilder();
        		    		do {
        		    			res.appendCodePoint(c);
        		    			c = read();
        		    		} while (!isEndOfLine(c));
        		    		return res.toString();
        		    	}

        		    	private static int[] nextIntArray(int n) {
        		    		int[] arr = new int[n];
        		    		for (int i = 0; i < n; i++) {
        		    			arr[i] = nextInt();
        		    		}
        		    		return arr;
        		    	}

        		    	private static int[][] next2dArray(int n, int m) {
        		    		int[][] arr = new int[n][m];
        		    		for (int i = 0; i < n; i++) {
        		    			for (int j = 0; j < m; j++) {
        		    				arr[i][j] = nextInt();
        		    			}
        		    		}
        		    		return arr;
        		    	}
        		    	private static char[][] nextCharArray(int n,int m){
        		    		char [][]c=new char[n][m];
        		    		for(int i=0;i<n;i++){
        		    			String s=nextLine();
        		    			for(int j=0;j<s.length();j++){
        		    				c[i][j]=s.charAt(j);
        		    			}
        		    		}
        		    		return c;
        		    	}

        		    	private static long[] nextLongArray(int n) {
        		    		long[] arr = new long[n];
        		    		for (int i = 0; i < n; i++) {
        		    			arr[i] = nextLong();
        		    		}
        		    		return arr;
        		    	}

        		    	private static void pArray(int[] arr) {
        		    		for (int i = 0; i < arr.length; i++) {
        		    			pw.print(arr[i] + " ");
        		    		}
        		    		pw.println();
        		    		return;
        		    	}

        		    	private static void pArray(long[] arr) {
        		    		for (int i = 0; i < arr.length; i++) {
        		    			pw.print(arr[i] + " ");
        		    		}
        		    		pw.println();
        		    		return;
        		    	}

        		    	private static void pArray(boolean[] arr) {
        		    		for (int i = 0; i < arr.length; i++) {
        		    			pw.print(arr[i] + " ");
        		    		}
        		    		pw.println();
        		    		return;
        		    	}

        		    	private static boolean isSpaceChar(int c) {
        		    		if (filter != null)
        		    			return filter.isSpaceChar(c);
        		    		return isWhitespace(c);
        		    	}

        		    	private interface SpaceCharFilter {
        		    		public boolean isSpaceChar(int ch);
        		    	}

    }

        		    class Node{
        		    	int to;
        		    	long dist;
        		    	Node(int to,long dist){
        		    		this.to=to;
        		    		this.dist=dist;
        		    	}

        		    }
        		    class Pair implements Comparable<Pair>{

    					int  grade,essay;
    					Pair(int grade, int essay){

    						this.grade=grade;
    						this.essay=essay;
    					}
    					@Override
    					public int compareTo(Pair o) {

    					/*	if(((double)a/(double)b)!=((double)o.a/(double)o.b))
    						return (int)(((double)o.a/(double)o.b)-((double)a/(double)b));
    						else*/
    							return essay-o.essay;
    						//return (int)(o.size-size);
    					}
    					public int hashCode() {
    							//int hu = (int) (x ^ (x >>> 32));
    							//int hv = (int) (y ^ (y >>> 32));
    							//int hw = (int) (mass ^ (mass >>> 32));
    							//return 31 * hu + hv ;
    						return 0;
    						}
    						public boolean equals(Object o) {
    							Pair other = (Pair) o;
    						//	return x == other.x && y == other.y;
    						return false;
    						}
    				}  class Dsu{
	    		    	private int rank[], parent[] ,n;
	    		    	private static int[] parent1;
	    		    	Dsu(int size){
	    		    		this.n=size+1;
	    		    		rank=new int[n];
	    		    		//parent=new int[n];
	    		    		parent=new int[n];
	    		    	makeSet();

	    		    	}

	    		    	void makeSet(){
	    		    		for(int i=0;i<n;i++){
	    		    			parent[i]=i;
	    		    		}
	    		    	}

	    		    	int find(int x){
	    		    		if(parent[x]!=x){

	    		    			parent[x]=find(parent[x]);
	    		    		}
	    		    		return parent[x];
	    		    	}

	    		    	boolean union(int x,int y){
	    		    		int xRoot=find(x);
	    		    		int yRoot=find(y);

	    		    		if(xRoot==yRoot)
	    		    			return false;
	    		    		if(rank[xRoot]<rank[yRoot]){
	    		    		parent[xRoot]=yRoot;
	    		    		}else if(rank[yRoot]<rank[xRoot]){
	    		    			parent[yRoot]=xRoot;
	    		    		}else{
	    		    			parent[yRoot]=xRoot;
	    		    			rank[xRoot]++;
	    		    		}
	    		    		return true;
	    		    	}

	    		    }


import java.io.*;
import java.util.*;
public class BalancedParan
{
    public static void main(String args[])
    {
        try{
        Scanner sc=new Scanner(System.in);
       // int t=sc.nextInt();
      //  while(--t>=0){
       // int n=sc.nextInt();
       String s=sc.next();
        int cap1=0;
        for(int i=0;i<s.length();i++){
            if(s.charAt(i)>='a'&&s.charAt(i)<='z')
            cap1++;
        }
        int sub=0,min=0;
        for(int i=s.length()-1;i>=0;i--){
            if(s.charAt(i)>='a'&&s.charAt(i)<='z')
            sub=sub-1;
            else
            sub=sub+1;
            min=Math.min(min,sub);
        }
        System.out.println(cap1+min);
      //  }
        }catch(Exception e){
            return;
        }
    }
}


import java.util.*;
import java.io.*;

public class  Letter
{
	public static void main(String[] args) throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw=new PrintWriter(System.out);

		int t=1;

		while(t-->0)
		{
			char a[]=br.readLine().trim().toCharArray();
			int n=a.length;

			int u[]=new int[n+1];
			int l[]=new int[n+1];

			for(int i=0;i<n;i++)
			{
				if(a[i]>96)
				{
					u[i+1]=u[i];
					l[i+1]=l[i]+1;
				}
				else
				{
					u[i+1]=u[i]+1;
					l[i+1]=l[i];
				}
			}

			int ans=Integer.MAX_VALUE;

			for(int i=1;i<n;i++)
			{
				int x=l[i-1];
				int y=u[n]-u[i+1];

				if(ans>x+y)
					ans=x+y;
			}

			pw.println(ans);
		}
		pw.flush();
	}

}


import java.util.*;
import java.io.*;

public class  Letter
{
	public static void main(String[] args) throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw=new PrintWriter(System.out);

		int t=1;

		while(t-->0)
		{
			char a[]=br.readLine().trim().toCharArray();
			int n=a.length;

			if(n==1)
			{
				System.out.println(0);
				System.exit(0);
			}

			int u[]=new int[n+1];
			int l[]=new int[n+1];

			for(int i=0;i<n;i++)
			{
				if(a[i]>96)
				{
					u[i+1]=u[i];
					l[i+1]=l[i]+1;
				}
				else
				{
					u[i+1]=u[i]+1;
					l[i+1]=l[i];
				}
			}

			int ans=Integer.MAX_VALUE;

			for(int i=1;i<n;i++)
			{
				int x=l[i-1];
				int y=u[n]-u[i];

				if(ans>x+y)
					ans=x+y;
			}
			ans=Math.min(ans,u[n]);
			ans=Math.min(ans,l[n]);
			pw.println(ans);
		}
		pw.flush();
	}

}


import java.util.Scanner;

public class letter {

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		String word = sc.nextLine();
		int[] letters = new int[word.length()];

		int count = 0;
		//0 is lowercase, 1 is uppercase
		for(int i = 0; i < word.length(); i++)
		{
			if(Character.isUpperCase(word.charAt(i)))
			{
				letters[i] = 1;
				count++;
			}
		}

		int[] changes = new int[word.length()+1];
		changes[0] = count;
		for(int j = 1; j < word.length()+1; j++)
		{
			if(letters[j-1] == 1)
				changes[j] = changes[j-1]-1;
			else
				changes[j] = changes[j-1]+1;
		}

		int min = Integer.MAX_VALUE;
		for(int k = 0; k < changes.length; k++)
		{
			min = Math.min(min, changes[k]);
		}

		System.out.println(min);
	}

}


import java.util.*;
import java.io.*;
public class Solution1{

	public static int fancy(char a[], int n){

		int lower[]=new int[n];
		if(Character.isLowerCase(a[0]))	lower[0]=1;

		for(int i=1;i<n;i++){
			lower[i]=lower[i-1];
			if(Character.isLowerCase(a[i]))
				lower[i]+=1;
		}

		int upper[]=new int[n];
		if(Character.isUpperCase(a[n-1])) upper[n-1]=1;

		for(int i=n-2;i>=0;i--){
			upper[i]=upper[i+1];
			if(Character.isUpperCase(a[i]))
				upper[i]+=1;
		}

		int min=n;
		for(int i=0;i<n;i++)
			min=Math.min(min, lower[i]+upper[i]);

		return min-1;
	}

	public static void main(String args[]){

		Scanner in=new Scanner(new BufferedReader(new InputStreamReader(System.in)));

		char a[]=in.next().toCharArray();
		int n=a.length;

		System.out.println(fancy(a,n));
	}
}


import java.util.*;
import java.io.*;
public class Solution1{

	public static int fancy(char a[], int n){

		boolean check=true;
		int upper=0,lower=0;

		for(int i=0;i<n;i++){
			if(check && Character.isUpperCase(a[i]))
				continue;

			check=false;
			if(Character.isUpperCase(a[i]))
				upper+=1;
			else
				lower+=1;
		}

		if(!check){
			for(int i=n-1;i>=0;i--)
				if(Character.isLowerCase(a[i]))
					lower-=1;
				else
					break;
		}

		//System.out.println(lower+" "+upper);
		return Math.min(lower,upper);
	}

	public static void main(String args[]){

		Scanner in=new Scanner(new BufferedReader(new InputStreamReader(System.in)));

		char a[]=in.next().toCharArray();
		int n=a.length;

		System.out.println(fancy(a,n));
	}
}


import java.util.*;
import java.io.*;
public class Solution1{

	public static int fancy(char a[], int n){

		boolean check=true;
		int upper=0,lower=0;

		for(int i=0;i<n;i++){
			if(check && Character.isUpperCase(a[i]))
				continue;

			check=false;
			if(Character.isUpperCase(a[i]))
				upper+=1;
			else
				lower+=1;
		}

		if(!check){
			for(int i=n-1;i>=0;i--)
				if(Character.isLowerCase(a[i])){
					lower-=1;
					break;
				}
		}

		//System.out.println(lower+" "+upper);
		return Math.min(lower,upper);
	}

	public static void main(String args[]){

		Scanner in=new Scanner(new BufferedReader(new InputStreamReader(System.in)));

		char a[]=in.next().toCharArray();
		int n=a.length;

		System.out.println(fancy(a,n));
	}
}


import java.util.*;
import java.io.*;
public class Solution1{

	public static int fancy(char a[], int n){

		boolean check=true;
		int upper=0,lower=0;

		for(int i=0;i<n;i++){
			if(check && Character.isUpperCase(a[i]))
				continue;

			check=false;
			if(Character.isUpperCase(a[i]))
				upper+=1;
			else
				lower+=1;
		}

		return Math.min(lower,upper);
	}

	public static void main(String args[]){

		Scanner in=new Scanner(new BufferedReader(new InputStreamReader(System.in)));

		char a[]=in.next().toCharArray();
		int n=a.length;

		System.out.println(fancy(a,n));
	}
}


import java.util.*;
import java.io.*;

public class Main {
	BufferedReader in;
	PrintWriter out;
	StringTokenizer str;

	private String next() throws Exception {
		if (str == null || !str.hasMoreElements())
			str = new StringTokenizer(in.readLine());
		return str.nextToken();
	}

	private int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	public void run() throws Exception {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		char []a = next().toCharArray();
		int n = a.length;

		int upper = 0, lower = 0, ret = 0;
		for(int i = 0; i < n; ++i) {
			if (isUpper(a[i])) {
				++upper;
			} else {
				++lower;
			}
		}

		ret = Math.min(upper, lower);

		int i = 0;
		while(i < n && isUpper(a[i])) {
			++i;
		}
		int lret = 0;
		for(int j = i; j < n; ++j) {
			if (isUpper(a[j])) {
				++lret;
			}
		}
		out.println(Math.min(ret, lret));
		out.close();
	}

	private boolean isUpper(char a) {
		if ('A' <= a && a <= 'Z') return true;
		return false;
	}

	public static void main(String args[]) throws Exception {
		new Main().run();
	}
}


import java.util.*;
import java.io.*;

public class Main {
	BufferedReader in;
	PrintWriter out;
	StringTokenizer str;

	private String next() throws Exception {
		if (str == null || !str.hasMoreElements())
			str = new StringTokenizer(in.readLine());
		return str.nextToken();
	}

	private int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	public void run() throws Exception {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		char []a = next().toCharArray();
		int n = a.length;
		int i = 0;
		while(i < n && isUpper(a[i])) {
			++i;
		}
		int ret = 0;
		for(int j = i; j < n; ++j) {
			if (isUpper(a[j])) {
				++ret;
			}
		}
		out.println(ret);
		out.close();
	}

	private boolean isUpper(char a) {
		if ('A' <= a && a <= 'Z') return true;
		return false;
	}

	public static void main(String args[]) throws Exception {
		new Main().run();
	}
}


import java.util.*;
import java.io.*;

public class Main {
	BufferedReader in;
	PrintWriter out;
	StringTokenizer str;

	private String next() throws Exception {
		if (str == null || !str.hasMoreElements())
			str = new StringTokenizer(in.readLine());
		return str.nextToken();
	}

	private int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	public void run() throws Exception {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		char []a = next().toCharArray();
		int n = a.length;

		int upper = 0, lower = 0, ret = 0;
		for(int i = 0; i < n; ++i) {
			if (isUpper(a[i])) {
				++upper;
			} else {
				++lower;
			}
		}

		ret = Math.min(upper, lower);

		int i = 0;
		while(i < n && isUpper(a[i])) {
			++i;
		}
		int lret = 0;
		for(int j = i; j < n; ++j) {
			if (isUpper(a[j])) {
				++lret;
			}
		}
		ret = Math.min(ret, lret);

		i = 0;
		lret = 0;
		while(i < n && !isUpper(a[i])) {
			++i;
			++lret;
		}

		while(i < n && isUpper(a[i])) {
			++i;
		}

		for(int j = i; j < n; ++j) {
			if (isUpper(a[j])) {
				++lret;
			}
		}
		out.println(Math.min(ret, lret));
		out.close();
	}

	private boolean isUpper(char a) {
		if ('A' <= a && a <= 'Z') return true;
		return false;
	}

	public static void main(String args[]) throws Exception {
		new Main().run();
	}
}


import java.util.*;
import java.io.*;

public class Main {
	BufferedReader in;
	PrintWriter out;
	StringTokenizer str;

	private String next() throws Exception {
		if (str == null || !str.hasMoreElements())
			str = new StringTokenizer(in.readLine());
		return str.nextToken();
	}

	private int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	public void run() throws Exception {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		char []a = next().toCharArray();
		int n = a.length;

		int [][]dp = new int[n][2];
		if (isUpper(a[0])) {
			dp[0][0] = 0;
			dp[0][1] = 1;
		} else {
			dp[0][0] = 1;
			dp[0][1] = 0;
		}
		for(int i = 1; i < n; ++i) {
			if (isUpper(a[i])) {
				dp[i][0] = dp[i-1][0];
				dp[i][1] = Math.min(dp[i-1][0], dp[i-1][1]) + 1;
			} else {
				dp[i][0] = dp[i-1][0] + 1;
				dp[i][1] = Math.min(dp[i-1][0], dp[i-1][1]);
			}
		}

		out.println(Math.min(dp[n-1][0], dp[n-1][1]));
		out.close();
	}

	private boolean isUpper(char a) {
		if ('A' <= a && a <= 'Z') return true;
		return false;
	}

	public static void main(String args[]) throws Exception {
		new Main().run();
	}
}


import java.io.*;
import java.util.*;
import java.math.*;

 public class cb {

	InputStream is;
	static PrintWriter out;
    void solve()
    {
	    char ch[]=ns().toCharArray();
        int n=ch.length;
        int uc[]=new int[n];
        int lc[]=new int[n];
        uc[0]=((int)(ch[0])>=97)?1:0;
        lc[n-1]=((int)(ch[n-1])>=97)?0:1;

        //out.println();
        for(int i=1;i<n;i++)
        {
            int val=(int)(ch[i]);
            uc[i]=uc[i-1];
            if(val>=97 && val<=122)
                uc[i]++;

        }

        for(int i=n-2;i>=0;i--)
        {
            int val=(int)(ch[i]);
            lc[i]=lc[i+1];
            if(val>=65 && val<=90)
                lc[i]++;

        }
        int min=Integer.MAX_VALUE;
        for(int i=0;i<n;i++)
        {
            min=Math.min(uc[i]+lc[i]-1,min);
        }
        out.println(min);

	}

    //---------- I/O Template ----------

    public static void main(String[] args) { new cb().run(); }
    void run() {
        is = System.in;
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }

    byte input[] = new byte[1024];
    int len = 0, ptr = 0;

    int readByte() {
        if(ptr >= len) { ptr = 0;
            try { len = is.read(input); }
            catch(IOException e) { throw new InputMismatchException(); }
            if(len <= 0) { return -1; }
        } return input[ptr++];
    }
    boolean isSpaceChar(int c) { return !( c >= 33 && c <= 126 ); }
    int skip() {
        int b = readByte();
        while(b != -1 && isSpaceChar(b)) { b = readByte(); }
        return b;
    }

    char nc() { return (char)skip(); }
    String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!isSpaceChar(b)) { sb.appendCodePoint(b); b = readByte(); }
        return sb.toString();
    }
    String nLine() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while( !(isSpaceChar(b) && b != ' ') ) { sb.appendCodePoint(b); b = readByte(); }
        return sb.toString();
    }
    int ni() {
        int n = 0, b = readByte();
        boolean minus = false;
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); }
        if(b == '-') { minus = true; b = readByte(); }
        if(b == -1) { return -1; }  //no input
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); }
        return minus ? -n : n;
    }
    long nl() {
        long n = 0L;    int b = readByte();
        boolean minus = false;
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); }
        if(b == '-') { minus = true; b = readByte(); }
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); }
        return minus ? -n : n;
    }

    double nd() { return Double.parseDouble(ns()); }
    float nf() { return Float.parseFloat(ns()); }
    int[] na(int n) {
        int a[] = new int[n];
        for(int i = 0; i < n; i++) { a[i] = ni(); }
        return a;
    }
    char[] ns(int n) {
        char c[] = new char[n];
        int i, b = skip();
        for(i = 0; i < n; i++) {
            if(isSpaceChar(b)) { break; }
            c[i] = (char)b; b = readByte();
        } return i == n ? c : Arrays.copyOf(c,i);
    }
	static void pa(int a[])
	{
		for(int i=0;i<a.length;i++)
		out.print(a[i]+" ");
		out.println();
	}

}


import java.io.*;
import java.util.*;
import java.math.*;

public class cb {

	InputStream is;
	static PrintWriter out;
    void solve()
    {
	    char ch[]=ns().toCharArray();
        int uc=0,lc=0;
        int n=ch.length;
        int luc=-1,llc=-1;
        for(int i=n-1;i>=0;i--)
        {
            int val=(int)(ch[i]);
            if(val>=65 && val<=90)
            {
                luc=i;
                break;
            }
        }

        for(int i=0;i<n;i++)
        {
            int val=(int)(ch[i]);
            if(val>=97 && val<=122)
            {
                llc=i;
                break;
            }
        }

        if(luc==-1 || llc==-1){
            out.println(0);return;}

        int min=Integer.MAX_VALUE;
        for(int i=0;i<=luc;i++)
        {
            int val=(int)(ch[i]);
             if(val>=97 && val<=122)
            {
                lc++;

            }
        }

        for(int i=n-1;i>=llc;i--)
        {
            int val=(int)(ch[i]);
             if(val>=65 && val<=90)
            {
                uc++;

            }
        }

           out.println(Math.min(uc,lc));

	}

    //---------- I/O Template ----------

    public static void main(String[] args) { new cb().run(); }
    void run() {
        is = System.in;
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }

    byte input[] = new byte[1024];
    int len = 0, ptr = 0;

    int readByte() {
        if(ptr >= len) { ptr = 0;
            try { len = is.read(input); }
            catch(IOException e) { throw new InputMismatchException(); }
            if(len <= 0) { return -1; }
        } return input[ptr++];
    }
    boolean isSpaceChar(int c) { return !( c >= 33 && c <= 126 ); }
    int skip() {
        int b = readByte();
        while(b != -1 && isSpaceChar(b)) { b = readByte(); }
        return b;
    }

    char nc() { return (char)skip(); }
    String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!isSpaceChar(b)) { sb.appendCodePoint(b); b = readByte(); }
        return sb.toString();
    }
    String nLine() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while( !(isSpaceChar(b) && b != ' ') ) { sb.appendCodePoint(b); b = readByte(); }
        return sb.toString();
    }
    int ni() {
        int n = 0, b = readByte();
        boolean minus = false;
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); }
        if(b == '-') { minus = true; b = readByte(); }
        if(b == -1) { return -1; }  //no input
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); }
        return minus ? -n : n;
    }
    long nl() {
        long n = 0L;    int b = readByte();
        boolean minus = false;
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); }
        if(b == '-') { minus = true; b = readByte(); }
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); }
        return minus ? -n : n;
    }

    double nd() { return Double.parseDouble(ns()); }
    float nf() { return Float.parseFloat(ns()); }
    int[] na(int n) {
        int a[] = new int[n];
        for(int i = 0; i < n; i++) { a[i] = ni(); }
        return a;
    }
    char[] ns(int n) {
        char c[] = new char[n];
        int i, b = skip();
        for(i = 0; i < n; i++) {
            if(isSpaceChar(b)) { break; }
            c[i] = (char)b; b = readByte();
        } return i == n ? c : Arrays.copyOf(c,i);
    }
	static void pa(int a[])
	{
		for(int i=0;i<a.length;i++)
		out.print(a[i]+" ");
		out.println();
	}

}


import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class C {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		char[] s = ns(100001);
		int n = s.length;
		int[] up = new int[n];
		for(int i = 0;i < n;i++){
			if(s[i] >= 'A' && s[i] <= 'Z'){
				up[i] = 1;
			}
		}
		int[] upct = new int[n+1];
		int[] downct = new int[n+1];
		for(int i = 1;i <= n;i++){
			upct[i] = upct[i-1] + (1-up[i-1]);
			downct[n-i] = downct[n-i+1] + up[n-i];
		}
		// i,n-i
		int min = 99999999;
		for(int i = 0;i <= n;i++){
			min = Math.min(min, upct[i] + downct[i]);
		}
		out.println(min);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new C().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.util.*;
public class Letter {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        int d=s.length();
        int u1=0;
        int l1=0;
        int u2=0;
        int l2=0;
       int k=0;
        if(d%2==1)
        {
            k=d/2;
            if(Character.isUpperCase(s.charAt(k)))
                k=k+1;
        }
        else
        {
            k=d/2;
        }

            for(int i=0;i<k;i++)
            {
                if(Character.isUpperCase(s.charAt(i)))
                    u1++;
                else
                    l1++;
            }
            for(int i=k;i<d;i++)
            {
                if(Character.isUpperCase(s.charAt(i)))
                    u2++;
                else
                    l2++;
            }

        if(l1+l2==0 || u1+u2==0)
        {
            System.out.println("0");
            return;
        }
       // System.out.println(l1+" "+l2+" "+u1+" "+u2);
        int upp=l1+l2;
        int low=u1+u2;
        int c=l1+u2;
      //  System.out.println(upp);
        int m=Math.min(upp, Math.min(low, c));
        System.out.println(m);
    }
}


#include<stdio.h>
#include<iostream>
#include <iomanip>
#define ll long long
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn=1e6+5;
int main() {
	std::ios::sync_with_stdio(false);
	int h,l;
	cin>>h>>l;
	long double a=(l*l*1.0-h*h*1.0)/(2*h);
	cout<<fixed<<setprecision(9);
	cout<<a<<endl;
	return 0;
}


#include<stdio.h>
#include<iostream>
#include <iomanip>
#define ll long long
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn=1e6+5;
const double eps=1e-7;
int main() {
	std::ios::sync_with_stdio(false);
	int h,l;
	cin>>h>>l;
	long double a=(l*l*1.0)/(2*h)-(h*1.0)/2;
	cout<<fixed<<setprecision(9);
	cout<<a<<endl;
	return 0;
}


#include<stdio.h>
#include<iostream>
#define ll long long
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn=1e6+5;
int main() {
	std::ios::sync_with_stdio(false);
	int h,l;
	cin>>h>>l;
	long double a=(l*l*1.0-h*h*1.0)/(2*h);
	cout<<a<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long double L,H;
    cin>>L>>H;
    printf("%.13lf\n",(L*L−H*H)/(2*H));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long double L,H;
    cin>>L>>H;
    printf("%.13f\n",(L*L−H*H)/(2*H));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    double L,H;
    cin>>L>>H;
    printf("%.13f\n",(L*L−H*H)/(2*H));
    return 0;
}


#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
int main(){
    double L,H;
    cin>>H>>L;
    printf("%.13f\n",(L*L-H*H)/(2.0*H));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    double L,H;
    cin>>H>>L;
    printf("%.13f\n",(L*L−H*H)/(2.0*H));
    return 0;
}


#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
int main(){
    double L,H;
    cin>>H>>L;
    printf("%.13f\n",(L*L−H*H)/(2.0*H));
    return 0;
}


#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main(void)
{
    ios::sync_with_stdio(false), cin.tie(0);
    double h, l;
    cin >> h >> l;
    cout << setprecision(13) << l*l-h*h)/(2.0*h) << endl;
    //printf("%.13f\n", (l*l-h*h)/(2.0*h));
    return 0;
}
//rk_no


#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main(void)
{
    ios::sync_with_stdio(false), cin.tie(0);
    double h, l;
    cin >> h >> l;
    printf("%.13f\n", (l*l-h*h)/(2.0*h));
    return 0;
}
//rk_no


#include <bits/stdc++.h>
using namespace std;

int main(void)
{
    ios::sync_with_stdio(false), cin.tie(0);
    int h, l;
    cin >> h >> l;
    int t = l*l-h*h;
    int k = 2*h;
    //cout << t << ' ' << k << endl;
    double ans = (double)t/(double)k;
    //cout << ans << endl;
    printf("%.13f\n", ans);
    return 0;
}
//rk_no


#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(void)
{
    ios::sync_with_stdio(false), cin.tie(0);
    int h, l;
    cin >> h >> l;
    int t = l*l-h*h;
    int k = 2*h;
    //cout << t << ' ' << k << endl;
    long double ans = (long double)t/(long double)k;
    //cout << ans << endl;
    printf("%.13lf\n", ans);
    return 0;
}
//rk_no


#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(void)
{
    ios::sync_with_stdio(false), cin.tie(0);
    int h, l;
    cin >> h >> l;
    int t = l*l-h*h;
    int k = 2*h;
    //cout << t << ' ' << k << endl;
    long double ans = (long double)t/(long double)k;
    //cout << ans << endl;
    printf("%.13Lf\n", ans);
    return 0;
}
//rk_no


#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main(void)
{
    ios::sync_with_stdio(false), cin.tie(0);
    double h, l;
    cin >> h >> l;
    cout << setprecision(13) << (l*l-h*h)/(2.0*h) << endl;
    //printf("%.13f\n", (l*l-h*h)/(2.0*h));
    return 0;
}
//rk_no


#include <bits/stdc++.h>
using namespace std;

char buff[1000];
int a[1000], lena;

void debug(int a[], int len)
{
    for (int i = 0; i < len; ++i) printf("%d", a[i]);
    printf("\n");
}

int main(void)
{
    ios::sync_with_stdio(false), cin.tie(0);
    int h, l;
    cin >> h >> l;
    long long t = 1ll*l*l-h*h;
    int k = 2*h;
    sprintf(buff, "%I64d", t);
    lena = strlen(buff);
    for (int i = 0; i < lena; ++i){
        a[i] = buff[i]-'0';
    }
    //debug(a, lena);
    int tmp = 0, flag = 0;
    for (int i = 0; i < lena; ++i){
        tmp = tmp*10 + a[i];
        if (tmp >= k){
            printf("%d", tmp/k);
            flag = 1;
            tmp %= k;
        }else{
            if (flag) printf("0");
        }
    }
    printf(".");
    for (int i = 0; i < 14; ++i){
        tmp = tmp*10;
        if (tmp >= k){
            printf("%d", tmp/k);
            tmp %= k;
        }else{
            printf("0");
        }
    }
    printf("\n");
    return 0;
}
//rk_no


#include<bits/stdc++.h>
using namespace std;
main(){
float a,b;
    cin >>a>>b;
    cout <<((a*a+b*b)/(2*a)) - a;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
main(){
float a,b;
    cin >>a>>b;
    cout <<((a*a+b*b)/2*a) - a;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
main(){
    double a,b,m;
    cin >>a>>b;
    m=((b*b-a*a)/(2*a));
    cout <<setprecision(10)<<m;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
main(){
    double a,b,m;
    cin >>a>>b;
    m=((b*b-a*a)/(2*a));
    cout <<setprecision(100)<<fixed<<m;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
main(){
    double a,b;
    cin >>a>>b;
    cout <<((a*a+b*b)/(2*a)) - a;
return 0;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    int h,l;
    cin >> h >>l;
  cout << (pow(l,2)-pow(h,2))/2h <<endl;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    float h,l;
    cin >> h >>l;
    cout<<fixed;
  cout << (float)((pow(l,2)-pow(h,2))/(2*h))<<endl;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    float h,l;
    cin >> h >>l;
  cout << (float)((pow(l,2)-pow(h,2))/(2*h))<<endl;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    int h,l;
    cin >> h >>l;
  cout << (float)((pow(l,2)-pow(h,2))/2*h） <<endl;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    int h,l;
    cin >> h >>l;
  cout << (float)((pow(l,2)-pow(h,2))/2*h)<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int h,l;
    cin>>h>>l;
    long  double ans=(l*l-h*h);
    ans/=2;
    ans/=h;
    printf("%.13lf",ans);
    return 0;
}
//1.5000000000000


#include<bits/stdc++.h>
using namespace std;
int main(){
    int h,l;
    cin>>h>>l;
    double ans=(l*l-h*h);
    ans/=2;
    ans/=h;
    printf("%.13lf",ans);
    return 0;
}
//1.5000000000000


#include<bits/stdc++.h>
using namespace std;
int main(){
    int h,l;
    cin>>h>>l;
    double ans=(l*l-h*h);
    ans/=2;
    ans/=h;
    printf("%.9f",ans);
    return 0;
}
//1.5000000000000


#include<bits/stdc++.h>
using namespace std;
int main(){
    double h,l;
    cin>>h>>l;
    double ans=(l*l-h*h)/(2*h);
    printf("%.9lf",ans);
    return 0;
}
//1.5000000000000


#include<bits/stdc++.h>
using namespace std;
int main(){
    int h,l;
    cin>>h>>l;
    float ans=(l*l-h*h);
    ans/=2;
    ans/=h;
    printf("%.13f",ans);
    return 0;
}
//1.5000000000000


#include<bits/stdc++.h>
using namespace std;
int main(){
    int h,l;
    cin>>h>>l;
    double ans=(l*l-h*h)/(2*h);
    printf("%.9lf",ans);
    return 0;
}
//1.5000000000000


 #include <bits/stdc++.h>

using namespace std;

int main(){
    float l,h,x;
    cin>>h>>l;
    x=((l^2)-(h^2))/(2*h);
    cout<<x;
    return 0;
}


#indlude <bits/stdc++.h>

using namespace std;

int main(){
    float l,h,x;
    cin>>h>>l;
    x=((l^2)-(h^2))/(2*h);
    cout<<x;
    return 0;
}


#indlude <iostream>

using namespace std;

int main(){
    float l,h,x;
    cin>>h>>l;
    x=((l^2)-(h^2))/(2*h);
    cout<<x;
    return 0;
}


#include bits/std.c++
using namespace std;

int main(){
    float l,h,x;
    cin>>h>>l;
    x=((l^2)-(h^2))/(2*h);
    cout<<x;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    double l,h,x;
    cin>>h>>l;
    x=((l*l)-(h*h))/(2*h);
    cout<<x;
    return 0;
}


 #include <bits/stdc++.h>

using namespace std;

int main(){
    float l,h,x;
    cin>>h>>l;
    x=((l*l)-(h*h))/(2*h);
    cout<<x;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    float l,h,x;
    cin>>h>>l;
    x=((l*l)-(h*h))/(2*h);
    cout<<fixed<<setprecision(7)<<x;
    return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<stack>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
#define fio ios::sync_with_stdio(false);cin.tie(0)
#define mem(a) memset(a,0,sizeof(a))
#define memm(a) memset(a,inf,sizeof(a))
#define ll long long
#define ld long double
#define uL unsigned long long
#define pb push_back
#define inf 0x3f3f3f3f
using namespace std;
const int N=1e5+5;
const int M=1e9+5;
int n,m,k,x,a[N],l,h,vis[N];

int main()
{
    double h,l;
     scanf("%lf%lf",&h,&l);
     printf("%.13f\n", (l*l-h*h)/2.0/h );
     return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<stack>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
#define fio ios::sync_with_stdio(false);cin.tie(0)
#define mem(a) memset(a,0,sizeof(a))
#define memm(a) memset(a,inf,sizeof(a))
#define ll long long
#define ld long double
#define uL unsigned long long
#define pb push_back
#define inf 0x3f3f3f3f
using namespace std;
const int N=1e5+5;
const int M=1e9+5;
int n,m,k,x,a[N],l,h,vis[N];

int main()
{
     scanf("%d%d",&h,&l);
     printf("%.13f\n",double((l*l-h*h)/2.0/h));
     return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<stack>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
#define mem(a) memset(a,0,sizeof(a))
#define memm(a) memset(a,inf,sizeof(a))
#define ll long long
#define ld long double
#define uL unsigned long long
#define pb push_back
#define inf 0x3f3f3f3f
using namespace std;
const int N=1e5+5;
const int M=100+5;
int n,m,k,a[N],h,l;
int cnt,sum,mx,st[N][20];

int main()
{
    cin>>h>>l;
    cout<<setprecision(13)<<double(double((l+h)*(l-h))/double((2*h)))<<endl;
    return 0;
}
/*
7 5 1
5 6 4 3 2 1 2
*/


#include<bits/stdc++.h>
#include<iostream>
#include<stack>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
#define fio ios::sync_with_stdio(false);cin.tie(0)
#define mem(a) memset(a,0,sizeof(a))
#define memm(a) memset(a,inf,sizeof(a))
#define ll long long
#define ld long double
#define uL unsigned long long
#define pb push_back
#define inf 0x3f3f3f3f
using namespace std;
const int N=1e5+5;
const int M=1e9+5;
int n,m,k,x,a[N],l,h,vis[N];

int main()
{
     ll h,l;
     scanf("%I64d%I64d",&h,&l);
     printf("%.13f\n", (l*l-h*h)/2.0/h );
     return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<stack>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
#define mem(a) memset(a,0,sizeof(a))
#define memm(a) memset(a,inf,sizeof(a))
#define ll long long
#define ld long double
#define uL unsigned long long
#define pb push_back
#define inf 0x3f3f3f3f
using namespace std;
const int N=1e5+5;
const int M=100+5;
int n,m,k,a[N],h,l;
int cnt,sum,mx,st[N][20];

int main()
{
    /*cin>>h>>l;
    cout<<setprecision(13)<<double((l+h)*(l-h)/(2.0*h))<<endl;*/
    scanf("%d%d",&h,&l);
    printf("%.13f\n",double(((l+h)/(2.0))*((l-h)/(double)h)));
    return 0;
}


#include<bits/stdc++.h>
#include<iostream>
#include<stack>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
#define mem(a) memset(a,0,sizeof(a))
#define memm(a) memset(a,inf,sizeof(a))
#define ll long long
#define ld long double
#define uL unsigned long long
#define pb push_back
#define inf 0x3f3f3f3f
using namespace std;
const int N=1e5+5;
const int M=100+5;
int n,m,k,a[N],h,l;
int cnt,sum,mx,st[N][20];

int main()
{
    /*cin>>h>>l;
    cout<<setprecision(13)<<double((l+h)*(l-h)/(2.0*h))<<endl;*/
    scanf("%d%d",&h,&l);
    printf("%.13f\n",(l+h)*(l-h)/(2.0*h));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	long double h, l;
	cin >> h >> l;
	long double x = (l*l - h * h) / (2 * h);
	cout << fixed << setprecision(10) << x;
}


#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	double h, l;
	cin >> h >> l;
	double x = (l*l - h * h) / (2 * h);
	cout << x;
}


#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	long double h, l;
	cin >> h >> l;
	long double x = (l*l - h * h) / (2 * h);
	printf("%.15f", x);
}


#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
signed main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	long double h, l;
	cin >> h >> l;
	long double x = (l*l - h * h) / (2 * h);
	printf("%.6f", x);
}


#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
signed main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	long double h, l;
	cin >> h >> l;
	long double x = (l*l - h * h) / (2 * h);
	printf("%.15f", x);
}


#include <iostream>
#include <stdio.h>
#include <array>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <iomanip>

#define PI 3.14159265358979323846

using namespace std;

int main() {
    int H, L; cin >> H >> L;
    long double theta = atan2(H,L);
    long double height = (long double)L*tan(0.5*PI - 2*theta);
    cout <<fixed<<setprecision(12) << height;
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <array>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <iomanip>

#define PI 3.14159265358979323846

using namespace std;

int main() {
    int H, L; cin >> H >> L;
    float theta = atan2(H,L);
    float height = (float)L*tan(0.5*PI - 2*theta);
    cout << setprecision(12) << height;
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <array>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <iomanip>

#define PI 3.14159265

using namespace std;

int main() {
    int H, L; cin >> H >> L;
    double theta = atan2(H,L);
    double height = (double)L*tan(0.5*PI - 2*theta);
    cout << height;
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <array>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <iomanip>
#include <sstream>
#include <cstring>

#define PI 3.14159265358979323846

using namespace std;

int main() {
    int H, L; cin >> H >> L;
    double hyp = sqrt(H*H + L*L);
    double theta = atan((double)L/H);
    double angy = 2*theta - (PI/2);
    double X = L*tan(angy);
    cout << fixed << setprecision(13) << X << endl;
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <array>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <iomanip>

#define PI 3.14159265358979323846

using namespace std;

int main() {
    int H, L; cin >> H >> L;
    float theta = atan2(H,L);
    float height = (float)L*tan(0.5*PI - 2*theta);
    cout << setprecision(8) << height;
    return 0;
}


#include<stdio.h>
int main()
{

    double h,l,a,b,res;
    scanf("%lf %lf",&h,&l);
    a=(l*l-h*h);
    b=a/(2*h);
    printf("%0.13lf",b);
    return 0;
}


#include<bits//stdc++.h>
using namespace std;
int main()
{
    double a,b,i,j,sum;
    cin>>a>>b;
    sum=(b*b-a*a)/(a*2);
    printf("%.13lf\n",sum);
}


#include<stdio.h>
int main()
{

    double h,l,a,b,res;
    scanf("%lf %lf",&h,&l);
    a=(l*l+h*h);
    b=a/(2*h);
    res=b-h;
    printf("%0.13lf",res);
    return 0;
}


#include<bits//stdc++.h>
using namespace std;
int main()
{
    double a,b,i,j,sum;
    cin>>a>>b;
    sum=(b*b-a)/(a*2);
    cout<<sum<<endl;
}


#include<iostream>
#include<algorithm>
//#include<cmath>
using namespace std;
int main(){
    double h,l;
    cin>>h>>l;
    printf("%.6f",(l*l-h*h)/2*h));
    return 0;
}


#include<iostream>
#include<algorithm>
//#include<cmath>
using namespace std;
int main(){
    int h,l;
    cin>>h>>l;
    cout<<(l^2-h^2)/2h<<endl;
    return 0;
}
#include<iostream>
#include<algorithm>
//#include<cmath>
using namespace std;
int main(){
    int h,l;
    cin>>h>>l;
    cout<<(l^2-h^2)/(2*h)<<endl;
    return 0;
}


#include<iostream>
#include<algorithm>
//#include<cmath>
using namespace std;
int main(){
    double h,l;
    cin>>h>>l;
    printf("%.6f",(l^2-h^2)/2*h));
    return 0;
}


#include<iostream>
#include<algorithm>
//#include<cmath>
using namespace std;
int main(){
    double h,l;
    cin>>h>>l;
    printf("%.6f",((l*l-h*h)/(2*h)));
    return 0;
}


#include<iostream>
#include<algorithm>
//#include<cmath>
using namespace std;
int main(){
    int h,l;
    cin>>h>>l;
    cout<<(l^2-h^2)/(2*h)<<endl;
    return 0;
}


#include<iostream>
#include<algorithm>
//#include<cmath>
using namespace std;
int main(){
    int h,l;
    cin>>h>>l;
    cout<<(l^2-h^2)/2h<<endl;
    return 0;
}


#include<iostream>
#include<algorithm>
//#include<cmath>
using namespace std;
int main(){
    double h,l;
    cin>>h>>l;
    printf("%.6f",((l*l-h*h)/2*h));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long h,l;
    cin>>h>>l;
    long a=(l-h)*(l+h);
    double b=2*h;
    cout<<a/b;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
   float h,l;
   cin>>h>>l;
   cout<<(l-h)*(l+h)/2*h;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long h,l;
    cin>>h>>l;
    long a=(l-h)*(l+h);
    long b=2*h;
    double c=a/b;
    cout<<fixed<<setprecision(13)<<c;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    double l,h;
    cin>>h>>l;
    printf("%.15lf",(l*l-h*h)/(2*h));
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long h,l;
    cin>>h>>l;
    double a=(l-h)*(l+h);
    double b=2*h;
    double c=a/b;
    cout<<fixed<<setprecision(13)<<c;
}


#include <bits/stdc++.h>
#include<iomanip>
using namespace std;
long double h,l;
long double  x,y;
int main() {
	cin>>h>>l;
	h*=100000;
	l*=100000;
	cout<<fixed<<showpoint<<setprecision(12)<<(l*l-h*h)/(2*h)/100000;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
long double h,l;
long double  x,y;
int main() {
	cin>>h>>l;
	h*=100000;
	l*=100000;
	printf("%Lf",(long double)(l*l-h*h)/(2*h)/100000);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long h,l;
long long x,y;
int main() {
	cin>>h>>l;
	h*=100000;
	l*=100000;
	printf("%lf",(double)(l*l-h*h)/(2*h)/100000);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
double h,l;
double x,y;
int main() {
	cin>>h>>l;
	cout<<(double)(l*l-h*h)/(2*h);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long h,l;
long long x,y;
int main() {
	cin>>h>>l;
	h*=1000000;
	l*=1000000;
	printf("%lf",(double)(l*l-h*h)/(2*h)/1000000);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long double l,h;
    cin>>h>>l;
    long double d;
    long long int k=((l*l)-(h*h));
    d=k/(2*h);

    printf("%.13lf\n",d);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long double l,h;
    cin>>h>>l;
    long double d;
    long long int k=((l*l)-(h*h));
    d=k/(2*h);
    cout<<k <<" "<<d<<endl;
    printf("%.13lf\n",d);
    return 0;
}


#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
int main()
{
    //double  l,h;

   double d,x,y;
   cin>>x>>y;
   //x=(double)h;
   //y=(double)l;
 //  cout<<x<<" "<<y<<endl;
   d=((y*y)-(x*x));
   //cout<<d<<" "<<y<<endl;
   d=d/(2*x*1.0000);
   cout<<fixed<<setprecision(13)<<d<<endl;
    //printf("%lf\n",d);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long double l,h;
    cin>>h>>l;
    long double d;
    long long int k=((l*l)-(h*h));
    d=(double)k/(2*h);
    printf("%.13lf\n",d);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    double l,h;
    cin>>h>>l;
    double d;
    int k=((l*l)-(h*h));
    d=k/(2*h);
    printf("%.13f\n",d);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long double l,h;
    cin>>h>>l;
    long double d;
    long long int k=((l*l)-(h*h));
    d=k/(2*h);
    printf("%.13lf\n",d);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int  l,h;
    cin>>h>>l;
    long double d,x,y;
   x=(double)h;
   y=(double)l;
   d=((y*y)-(x*x))/(2*h);
    printf("%.13lf\n",d);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long H,L;
main()
{
	cin>>H>>L;
	cout<<setprecision(12)<<abs((double)(L*L-H*H)/(2*H));
}


#include<bits/stdc++.h>
using namespace std;
int H,L;
main()
{
	cin>>H>>L;
	cout<<(float)(L*L-H*H)/(2*H);
}


#include<bits/stdc++.h>
using namespace std;
int H,L;
main()
{
	cin>>H>>L;
	cout<<setprecision(12)<<(double)(L*L-H*H)/(2*H);
}


#include<bits/stdc++.h>
using namespace std;

int main()
{

    int h, l;
    cin>>h>>l;
    double x = (double)((double) (l * l) - (double) (h * h)) / (double) (2.0 * h);
    cout<<showpoint<<setprecision(13)<<fixed<<x;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main()
{

    long long int h, l;
    cin>>h>>l;
    double x = (double)((double) (l * l) - (double) (h * h)) / (double) (2.0 * h);
    cout<<showpoint<<setprecision(13)<<fixed<<x;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main()
{

    int h, l;
    cin>>h>>l;
    float x = ((float)(l * l) - (float)(h * h)) / (float)(2 * h);
    cout<<setprecision(13)<<fixed<<x;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main()
{

    int h, l;
    cin>>h>>l;
    double x = ((double)(l * l) - (double)(h * h)) / (double)(2 * h);
    cout<<setprecision(13)<<fixed<<x;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main()
{

    int h, l;
    cin>>h>>l;
    double x = (double(l * l) - double(h * h)) / (double)(2 * h);
    cout<<setprecision(13)<<fixed<<x;
    return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long
#define pii pair<int,int>
#define eps 1e-11
const int maxn = 1e5 + 100;

double check(double a, double b, double c) {
    return (b * b + c * c) - a * a;
}
int main() {
    double h, l;
    cin >> h >> l;
    double li = 0.0, ri = 2 * 1e6;
    bool tag = false;
    while(ri - li > eps) {
        double mid = (li + ri) / 2.0;
        double ans = check(mid, mid - h, l);
        if(fabs(ans) < 1e-8) {
            tag = true;
            printf("%.13f", mid - h);
            break;
        } else {
            if(ans > 0.0) {
                li = mid;
            } else {
                ri = mid;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long
#define pii pair<int,int>
#define eps 1e-13
const int maxn = 1e5 + 100;

double check(double a, double b, double c) {
    return (b * b + c * c) - a * a;
}
int main() {
    double h, l;
    cin >> h >> l;
    double li = 0.0, ri = 2 * 1e6;
    bool tag = false;
    while(ri - li > eps) {
        double mid = (li + ri) / 2.0;
        double ans = check(mid, mid - h, l);
        if(fabs(ans) < 1e-10) {
            tag = true;
            printf("%.13f", mid - h);
            break;s
        } else {
            if(ans > 0.0) {
                li = mid;
            } else {
                ri = mid;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long
#define pii pair<int,int>
#define eps 1e-9
const int maxn = 1e5 + 100;

double check(double a, double b, double c) {
    return (b * b + c * c) - a * a;
}
int main() {
    double h, l;
    cin >> h >> l;
    double li = 0.0, ri = sqrt(2) * 1e6;
    bool tag = false;
    while(ri - li > eps) {
        double mid = (li + ri) / 2.0;
        double ans = check(mid, mid - h, l);
        if(fabs(ans) < 1e-9) {
            tag = true;
            printf("%.8f", mid - h);
            break;
        } else {
            if(ans > 0.0) {
                li = mid;
            } else {
                ri = mid;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long
#define pii pair<int,int>
#define eps 1e-13
const int maxn = 1e5 + 100;

double check(double a, double b, double c) {
    return (b * b + c * c) - a * a;
}
int main() {
    double h, l;
    cin >> h >> l;
    double li = 0.0, ri = 2 * 1e6;
    bool tag = false;
    while(ri - li > eps) {
        double mid = (li + ri) / 2.0;
        double ans = check(mid, mid - h, l);
        if(fabs(ans) < 1e-10) {
            tag = true;
            printf("%.13f", mid - h);
            break;
        } else {
            if(ans > 0.0) {
                li = mid;
            } else {
                ri = mid;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long
#define pii pair<int,int>
#define eps 1e-11
const int maxn = 1e5 + 100;

double check(double a, double b, double c) {
    return (b * b + c * c) - a * a;
}
int main() {
    double h, l;
    cin >> h >> l;
    double li = max(h, l), ri = sqrt(2) * 1e6;
    bool tag = false;
    while(ri - li > eps) {
        double mid = (li + ri) / 2.0;
        double ans = check(mid, mid - h, l);
        if(fabs(ans) < 1e-10) {
            tag = true;
            printf("%.10f", mid - h);
            break;
        } else {
            if(ans > 0.0) {
                li = mid;
            } else {
                ri = mid;
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long
#define pii pair<int,int>
#define eps 1e-11
const int maxn = 1e5 + 100;

double check(double a, double b, double c) {
    return (b * b + c * c) - a * a;
}
int main() {
    double h, l;
    cin >> h >> l;
    double ans = (l * l - h * h) / (2 * h);
    printf("%.13f\n", ans);
    return 0;
}


#include<stdio.h>
int main() {
	unsigned long long int H, L;
	scanf("%I64d",&H);
	scanf("%I64d",&L);
	long double y;
	y = (L*L - H * H) / (2.0 * H);
	printf("%llf",y);
	return 0;
}


#include<stdio.h>
int main() {
	unsigned long long int H, L;
	scanf("%I64d",&H);
	scanf("%I64d",&L);
	long double y;
	y = (L*L - H * H) / (2.0 * H);
	printf("%I64f",y);
	return 0;
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        for(int i = 0; i < 13; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        int k;

        if(v.size() > 30)
            k = 7;
        else k = 12;

        for(int i = 0; i < k; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        for(int i = 0; i < 14; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        int k;

        if(v.size() > 30)
            k = 13;
        else k = 17;

        for(int i = 0; i < k; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        for(int i = 0; i < 12; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        if(v.size() > 30)
            k = 13;
        else k = 17;

        for(int i = 0; i < k; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        for(int i = 0; i < 20; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        for(int i = 0; i < 18; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        int k;

        if(v.size() > 20)
            k = 13;
        else k = 17;

        for(int i = 0; i < k; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        for(int i = 0; i < 16; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        for(int i = 0; i < 17; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        for(int i = 0; i < 15; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        int k;

        if(v.size() > 20)
            k = 7;
        else k = 12;

        for(int i = 0; i < k; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        int k = 7;
        if(v.size() < 40)
            k = 12;
        if(v.size() < 20)
            k = 17;

        for(int i = 0; i < k; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    int F = 0;

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        if(F == 0)
        {
            cout << "? " << i + 1 << ' ' << c + 1 << endl;
            int p;
            cin >> p;
            z &= p;

            a[i] = z;
        }

        if(a[i] == 0)
        {
            F = 1;
            b = i;
        }
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        int k;

        if(v.size() > 20)
            k = 7;
        else k = 15;

        for(int i = 0; i < k; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 sdopgh

using namespace std;

int n, a[2055], b, c;

vector <int> v;

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rnd(time(NULL));

    cin >> n;

    for(int i = 0; i < n; i++)
        a[i] = -1;

    int f = 0;

    while(f == 0)
    {
        int x = rnd() % n;
        v.push_back(x);

        int p = 2047;

        for(int i = 0; i < 20; i++)
        {
            int y = x;
            while(y == x)
                y = rnd() % n;

            cout << "? " << x + 1 << ' ' << y + 1 << endl;

            int z;
            cin >> z;

            p &= z;
        }

        a[x] = p;

        for(auto to:v)
            if((p & a[to]) == 0)
        {
            b = x;
            c = to;
            f = 1;
        }
    }

    for(int i = 0; i < n; i++)
        if(a[i] == -1)
    {
        int z = 2047;

        cout << "? " << i + 1 << ' ' << b + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        cout << "? " << i + 1 << ' ' << c + 1 << endl;
        int p;
        cin >> p;
        z &= p;

        a[i] = z;
    }

    cout << "! ";
    for(int i = 0; i < n; i++)
        cout << a[i] << ' ';
}


#include <bits/stdc++.h>

using namespace std;

int n;
int t[20];
int cntt;
int p[3000];

mt19937 rng(chrono::steady_clock().now().time_since_epoch().count());

int rand(int a, int b) {
	return uniform_int_distribution<int>(a, b)(rng);
}

int query(int a, int b) {
	printf("? %d %d\n", a, b);
	fflush(stdout);
	int x;
	scanf("%d", &x);
	return x;
}

int magic(int i) {
	int res = 0;
	for(int c = 0 ; c < 12 ; c++)
		if(i != t[c])
			res |= (query(t[c], i) & (1 << c));
	return res;
}

int main() {
	scanf("%d", &n);

	while(cntt < 12) {
		int a = rand(1, n - 1);
		int b = rand(a + 1, n);
		int r = query(a, b);

		for(int c = 0 ; c < 12 ; c++) {
			if(!t[c] && !(r & (1 << c))) {
				cntt++;
				t[c] = a;
			}
		}
	}

	int idx = 1;
	int val = magic(1);

	for(int i = 2 ; i <= n ; i++) {
		int r = query(i, idx);
		if((r | val) == val) {
			idx = i;
			val = magic(idx);
		}
	}

	for(int i = 1 ; i <= n ; i++) {
		if(idx == i)
			p[i] = 0;
		else
			p[i] = query(i, idx);
	}

	printf("!");
	for(int i = 1 ; i <= n ; i++)
		printf(" %d", p[i]);
	printf("\n");

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n;
int t[20];
int cntt;

mt19937 rng(chrono::steady_clock().now().time_since_epoch().count());

int rand(int a, int b) {
	return uniform_int_distribution<int>(a, b)(rng);
}

int query(int a, int b) {
	printf("? %d %d\n", a, b);
	fflush(stdout);
	int x;
	scanf("%d", &x);
	return x;
}

int magic(int i) {
	int res = 0;
	for(int c = 0 ; c < 12 ; c++)
		if(i != t[c])
			res |= (query(t[c], i) & (1 << c));
	return res;
}

int main() {
	scanf("%d", &n);

	while(cntt < 12) {
		int a = rand(1, n - 1);
		int b = rand(a + 1, n);
		int r = query(a, b);

		for(int c = 0 ; c < 12 ; c++) {
			if(!t[c] && !(r & (1 << c))) {
				cntt++;
				t[c] = a;
			}
		}
	}

	int idx = 1;
	int val = magic(1);

	for(int i = 2 ; i <= n ; i++) {
		int r = query(i, idx);
		if((r | val) == val) {
			idx = i;
			val = magic(idx);
		}
	}

	printf("!");
	for(int i = 1 ; i <= n ; i++) {
		if(idx == i)
			printf(" 0");
		else
			printf(" %d", query(i, idx));
	}
	printf("\n");

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n;
int t[20];
int cntt;
int p[3000];

mt19937 rng(chrono::steady_clock().now().time_since_epoch().count());

int rand(int a, int b) {
	return uniform_int_distribution<int>(a, b)(rng);
}

int query(int a, int b) {
	printf("? %d %d\n", a, b);
	fflush(stdout);
	int x;
	scanf("%d", &x);
	return x;
}

int magic(int i) {
	int res = 0;
	for(int c = 0 ; c < 3 ; c++)
		if(i != t[c])
			res |= (query(t[c], i) & (1 << c));
	return res;
}

int main() {
	scanf("%d", &n);

	while(cntt < 12) {
		int a = rand(1, n - 1);
		int b = rand(a + 1, n);
		int r = query(a, b);

		for(int c = 0 ; c < 12 ; c++) {
			if(!t[c] && !(r & (1 << c))) {
				cntt++;
				t[c] = a;
			}
		}
	}

	int idx = 1;
	int val = magic(1);

	for(int i = 2 ; i <= n ; i++) {
		int r = query(i, idx);
		if((r | val) == val) {
			idx = i;
			val = magic(idx);
		}
	}

	for(int i = 1 ; i <= n ; i++) {
		if(idx == i)
			p[i] = 0;
		else
			p[i] = query(i, idx);
	}

	printf("!");
	for(int i = 1 ; i <= n ; i++)
		printf(" %d", p[i]);
	printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int N,id[3000],vis[3000],ans[3000],zero;
vector<int>v[3000];
int get(int x,int y){
	printf("? %d %d\n",x,y);
	fflush(stdout);
	int ret;
	scanf("%d",&ret);
	return ret;
}
int main(){
	scanf("%d",&N);
	srand(time(0));
	for (int i=1; i<=N; i++) id[i] = i;
	random_shuffle(id+1, id+N+1);
	int x = id[1], y = id[2], z = id[3], now = 4;
	while (now <= N){
		int t1 = get(x,y), t2 = get(y,z);
		for (int j=11; j>=0; j--){
			if (!(t1 & (1<<j))){
				v[j].push_back(x);
				v[j].push_back(y);
			}
		}
		for (int j=11; j>=0; j--){
			if(!(t2 & (1<<j))){
				v[j].push_back(y);
				v[j].push_back(z);
			}
		}
		if (t1 > t2){
			x = id[now++];
		} else if (t1 == t2){
			y = id[now++];
		} else z = id[now++];
	}
	int t1 = get(x,y), t2 = get(y,z);
	int a,b;
	if (t1 > t2){
		a = y, b = z;
	} else if (t1 == t2){
		a = x, b = z;
	} else a = x, b = y;

	int p = get(a,b);
	if (N == 3){
		int op = 0;
		for (int i=1; i<=3; i++){
			if (i==a && i==b) continue;
			op = i;
		}
		int p1 = get(a,op);
		int p2 = get(b,op);
		for (int i=11; i>=0; i--)
			if ((p1 & (1<<i)) && (p & (1<<i)) ) zero = b; else zero = a;
	} else{
//	if (N > 600){
		for (int i=11; i>=0; i--){
			if (p & (1<<i)) {
				if (v[i].size()>0 && v[i][0]!=a && v[i][0]!=b){
					int p1 = get(a,v[i][0]);
					int p2 = get(b,v[i][0]);
					if (p1 & (1<<i)) zero = b;
					if (p2 & (1<<i)) zero = a;
					break;
				} else {
					int f = rand()%N+1, g = rand()%N+1;
					int q;
					while (1){
						while (f == a || f == b) f = rand()%N+1;
						while (g == a || g == b) g = rand()%N+1;
						int p1 = get(f,g);
						if (p1 & (1<<i)) continue;
						q = f;
					}
					int p1 = get(a,q),p2 = get(b,q);
					if (p1 & (1<<i)) zero = b;
					else zero = a;
					break;
				}
			}
		}
	}
//	} else {
//		vis[a] = vis[b] = 1;
//		while (1){
//			int p = rand()%N + 1;
//			while (vis[p]) p = rand()%N + 1;
//			vis[p] = 1;
//			int t1 = get(a,p), t2 = get(b,p);
//			if (t1 == t2) continue;
//			if (t1 < t2) zero = a;
//			else zero = b;
//			break;
//		}
//	}
	for (int i=1; i<=N; i++){
		if (i == zero){
			ans[i] = 0;
			continue;
		}
		ans[i] = get(i,zero);
	}
	printf("! ");
	for (int i=1; i<=N; i++) printf("%d ",ans[i]);
	fflush(stdout);
	return 0;
}