package Souhu;
import java.util.Scanner;
import java.util.Stack;
/**
Created by gentl on 2017/9/17.
*/
public class T {
public static void main(String[] args){
Scanner in=new Scanner(System.in);
String p=in.next();
System.out.println(simplifyPath(p));
}
/**
@return
static public String simplifyPath(String path) {
Stack<String> stack = new Stack<String>();
String[] str = path.split("/");
//考虑/...
for(int i = 0; i < str.length; i++) {
//System.out.print(str[i]+" ");
if(str[i].equals(".")||str[i].equals("")){
} else if(str[i].equals("..")) {
stack.pop();
// System.out.print(ii+" ");
} else {
stack.add(str[i]);
//System.out.println(str[i]+" ");
}
}
if(stack.isEmpty()) return "/";
StringBuilder sb = new StringBuilder();
while(!stack.isEmpty()) {
if(stack.peek().equals("")) stack.pop();
else sb.insert(0, "/" + stack.pop());
}
return sb.length() == 0 ? "/" : sb.toString();
}
}