Calculating input impedance in a simple circuit
Your equation has a sign error.

Applying KCL at the \$U_{in}\$ node, see that the current through \$R\$ is from right to left which implies

$$U_{in} - I_{in} R = V_1$$

In fact, and more generally, recognize that the parallel resistor and controlled current source can be replaced with a resistor of resistance \$-R\$.

To see this, look at a similar pair in isolation driven by a current test source:







simulate this circuit &ndash; Schematic created using CircuitLab

The test source "sees", in this case, a \$-1\Omega\$ resistance.

To find the input impedance, use a similar approach to find the equivalent impedance of the circuit to the right of the negative resistor and then you will have reduced the circuit to a simple circuit with two series impedances.  The input impedance will then be obvious.