Challenge problemm

Can anyone tell me what is wrong in this?
My code is:

import java.util.*;

public class Main {

public static void main(String args[]) {
    Scanner scn = new Scanner(System.in);
	int x = scn.nextInt();
	if (x >= 1 && x <= 1000000000000000000 {
		int num = x;
		int count = 0;
		while (x != 0) {
			count++;
			x = x / 10;
		}
		int i;
		int[] arr = new int[count];
		i = count - 1;
		while (num != 0) {
			int rem = num % 10;
			arr[i] = rem;
			i--;
			num = num / 10;
		}
		for (i = 0; i < arr.length; i++) {
			int a = 9 - arr[i];
			int tmp = arr[i];
			if (i == 0 && a == 0) {
				arr[i] = tmp;
			} else if (a < tmp) {
				arr[i] = a;
			} else if (tmp < a) {
				arr[i] = tmp;
			}
		}
		int sum = 0, j = count - 1;
		for (i = 0; i < arr.length; i++) {
			sum = sum + arr[i] * (int) Math.pow(10, j);
			j--;
		}
		System.out.println(sum);
	}
}

}

Hey @VinayakSingh11111
There are two changes.
if (x >= 1 && x <= 1000000000000000000 { //redundant condition
x must be long
long x = scn.nextLong(); instead of int x = scn.nextInt();