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

class Main {
    public static void main(String[] args) {
        Map<String, Integer> bill = Map.of("Sugar", 100, "Potato", 50, "Rice", 200);
        int total = bill.entrySet().stream()
            .map(x -> x.getValue())
            .reduce(0, (acc, x) -> acc + x);

        System.out.println(total);
    }
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: