import java.util.Scanner;

public class cupom {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int v1 = sc.nextInt();
        int v2 = sc.nextInt();
        int v3 = sc.nextInt();
        int v4 = sc.nextInt();
        int k = sc.nextInt();
        
        int ans = 0;
        
        // config 1: (v1, v2) and (v3, v4)
        int c1 = (Math.abs(v1 - v2) <= k ? 1 : 0) + (Math.abs(v3 - v4) <= k ? 1 : 0);
        ans = Math.max(ans, c1);
        
        // config 2: (v1, v3) and (v2, v4)
        int c2 = (Math.abs(v1 - v3) <= k ? 1 : 0) + (Math.abs(v2 - v4) <= k ? 1 : 0);
        ans = Math.max(ans, c2);
        
        // config 3: (v1, v4) and (v2, v3)
        int c3 = (Math.abs(v1 - v4) <= k ? 1 : 0) + (Math.abs(v2 - v3) <= k ? 1 : 0);
        ans = Math.max(ans, c3);
        
        System.out.println(ans);
        sc.close();
    }
}
