the currents through resistor R