import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.InputMismatchException; public class QuantumLand { private static final InputReader in = new InputReader(System.in); private Node[] graph; public void solve() throws IOException { int n = in.readInt(); graph = new Node[n + 1]; for (int i = 1; i <= n; i++) { int w = in.readInt(); int pp = in.readInt(); graph[i] = new Node(i, w, (double) pp / 100); } double result = 0; for (int i = 1; i <= n; i++) { if (graph[i].visited) continue; Node current = graph[i]; ArrayList<Integer> traversed = new ArrayList<Integer>(); boolean f = false; while (!traversed.contains(current.index)) { if (current.visited) { f = true; break; } traversed.add(current.index); current.visited = true; current = graph[current.to]; } if (f) continue; double prob = 1; for (int j = traversed.indexOf(current.index); j < traversed.size(); j++) prob *= graph[traversed.get(j)].p; result += prob; } System.out.printf("%.2f\n", result); } public static void main(String[] args) throws IOException { new QuantumLand().solve(); } class Node { int index; int to; double p; boolean visited; public Node(int i, int t, double p) { this.visited = false; this.index = i; this.to = t; this.p = p; } } @SuppressWarnings("unused") private static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private SpaceCharFilter filter; public InputReader(InputStream stream) { this.stream = stream; } public 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++]; } public void readIntArray(int[] a) { for (int i = 0; i < a.length; i++) { a[i] = this.readInt(); } } public int readInt() { 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) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } }